<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">-- (c) The University of Glasgow, 1997-2006</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE BangPatterns, CPP, MagicHash, UnboxedTuples,
    GeneralizedNewtypeDeriving #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- We always optimise this, otherwise performance of a non-optimised</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- compiler is severely affected</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- There are two principal string types used internally by GHC:</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- ['FastString']</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">--   * A compact, hash-consed, representation of character strings.</span><span>
</span><span id="line-15"></span><span class="hs-comment">--   * Comparison is O(1), and you can get a 'GHC.Types.Unique.Unique' from them.</span><span>
</span><span id="line-16"></span><span class="hs-comment">--   * Generated by 'fsLit'.</span><span>
</span><span id="line-17"></span><span class="hs-comment">--   * Turn into 'GHC.Utils.Outputable.SDoc' with 'GHC.Utils.Outputable.ftext'.</span><span>
</span><span id="line-18"></span><span class="hs-comment">--</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- ['PtrString']</span><span>
</span><span id="line-20"></span><span class="hs-comment">--</span><span>
</span><span id="line-21"></span><span class="hs-comment">--   * Pointer and size of a Latin-1 encoded string.</span><span>
</span><span id="line-22"></span><span class="hs-comment">--   * Practically no operations.</span><span>
</span><span id="line-23"></span><span class="hs-comment">--   * Outputting them is fast.</span><span>
</span><span id="line-24"></span><span class="hs-comment">--   * Generated by 'sLit'.</span><span>
</span><span id="line-25"></span><span class="hs-comment">--   * Turn into 'GHC.Utils.Outputable.SDoc' with 'GHC.Utils.Outputable.ptext'</span><span>
</span><span id="line-26"></span><span class="hs-comment">--   * Requires manual memory management.</span><span>
</span><span id="line-27"></span><span class="hs-comment">--     Improper use may lead to memory leaks or dangling pointers.</span><span>
</span><span id="line-28"></span><span class="hs-comment">--   * It assumes Latin-1 as the encoding, therefore it cannot represent</span><span>
</span><span id="line-29"></span><span class="hs-comment">--     arbitrary Unicode strings.</span><span>
</span><span id="line-30"></span><span class="hs-comment">--</span><span>
</span><span id="line-31"></span><span class="hs-comment">-- Use 'PtrString' unless you want the facilities of 'FastString'.</span><span>
</span><span id="line-32"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Data.FastString</span><span>
</span><span id="line-33"></span><span>       </span><span class="hs-special">(</span><span>
</span><span id="line-34"></span><span>        </span><span class="annot"><span class="hs-comment">-- * ByteString</span></span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#bytesFS"><span class="hs-identifier">bytesFS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#fastStringToByteString"><span class="hs-identifier">fastStringToByteString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#mkFastStringByteString"><span class="hs-identifier">mkFastStringByteString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#fastZStringToByteString"><span class="hs-identifier">fastZStringToByteString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#unsafeMkByteString"><span class="hs-identifier">unsafeMkByteString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-40"></span><span>
</span><span id="line-41"></span><span>        </span><span class="annot"><span class="hs-comment">-- * ShortByteString</span></span><span>
</span><span id="line-42"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#fastStringToShortByteString"><span class="hs-identifier">fastStringToShortByteString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#mkFastStringShortByteString"><span class="hs-identifier">mkFastStringShortByteString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>
</span><span id="line-45"></span><span>        </span><span class="annot"><span class="hs-comment">-- * FastZString</span></span><span>
</span><span id="line-46"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#FastZString"><span class="hs-identifier">FastZString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-47"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#hPutFZS"><span class="hs-identifier">hPutFZS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-48"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#zString"><span class="hs-identifier">zString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#lengthFZS"><span class="hs-identifier">lengthFZS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span>        </span><span class="annot"><span class="hs-comment">-- * FastStrings</span></span><span>
</span><span id="line-52"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier">FastString</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>     </span><span class="hs-comment">-- not abstract, for now.</span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Construction</span></span><span>
</span><span id="line-55"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier">fsLit</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-56"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier">mkFastString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-57"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#mkFastStringBytes"><span class="hs-identifier">mkFastStringBytes</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-58"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#mkFastStringByteList"><span class="hs-identifier">mkFastStringByteList</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-59"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#mkFastString%23"><span class="hs-identifier">mkFastString#</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Deconstruction</span></span><span>
</span><span id="line-62"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier">unpackFS</span></a></span><span class="hs-special">,</span><span>           </span><span class="hs-comment">-- :: FastString -&gt; String</span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Encoding</span></span><span>
</span><span id="line-65"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#zEncodeFS"><span class="hs-identifier">zEncodeFS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Operations</span></span><span>
</span><span id="line-68"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#uniqueOfFS"><span class="hs-identifier">uniqueOfFS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-69"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#lengthFS"><span class="hs-identifier">lengthFS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-70"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#nullFS"><span class="hs-identifier">nullFS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-71"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#appendFS"><span class="hs-identifier">appendFS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-72"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#headFS"><span class="hs-identifier">headFS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-73"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#concatFS"><span class="hs-identifier">concatFS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-74"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#consFS"><span class="hs-identifier">consFS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-75"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#nilFS"><span class="hs-identifier">nilFS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-76"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#isUnderscoreFS"><span class="hs-identifier">isUnderscoreFS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Outputting</span></span><span>
</span><span id="line-79"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#hPutFS"><span class="hs-identifier">hPutFS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Internal</span></span><span>
</span><span id="line-82"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#getFastStringTable"><span class="hs-identifier">getFastStringTable</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-83"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#getFastStringZEncCounter"><span class="hs-identifier">getFastStringZEncCounter</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-84"></span><span>
</span><span id="line-85"></span><span>        </span><span class="annot"><span class="hs-comment">-- * PtrStrings</span></span><span>
</span><span id="line-86"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#PtrString"><span class="hs-identifier">PtrString</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-87"></span><span>
</span><span id="line-88"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Construction</span></span><span>
</span><span id="line-89"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#sLit"><span class="hs-identifier">sLit</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-90"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#mkPtrString%23"><span class="hs-identifier">mkPtrString#</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-91"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#mkPtrString"><span class="hs-identifier">mkPtrString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-92"></span><span>
</span><span id="line-93"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Deconstruction</span></span><span>
</span><span id="line-94"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#unpackPtrString"><span class="hs-identifier">unpackPtrString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Operations</span></span><span>
</span><span id="line-97"></span><span>        </span><span class="annot"><a href="GHC.Data.FastString.html#lengthPS"><span class="hs-identifier">lengthPS</span></a></span><span>
</span><span id="line-98"></span><span>       </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-102"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span>
</span><span id="line-103"></span><span>
</span><span id="line-104"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Encoding.html"><span class="hs-identifier">GHC.Utils.Encoding</span></a></span><span>
</span><span id="line-105"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.IO.Unsafe.html"><span class="hs-identifier">GHC.Utils.IO.Unsafe</span></a></span><span>
</span><span id="line-106"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Panic.Plain.html"><span class="hs-identifier">GHC.Utils.Panic.Plain</span></a></span><span>
</span><span id="line-107"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-108"></span><span>
</span><span id="line-109"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Concurrent.MVar.html#"><span class="hs-identifier">Control.Concurrent.MVar</span></a></span><span>
</span><span id="line-110"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#"><span class="hs-identifier">Control.DeepSeq</span></a></span><span>
</span><span id="line-111"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-112"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier">ByteString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-113"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.html#"><span class="hs-identifier">Data.ByteString.Short</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#ShortByteString"><span class="hs-identifier">ShortByteString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-114"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span>          </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BS</span></span><span>
</span><span id="line-115"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Char8.html#"><span class="hs-identifier">Data.ByteString.Char8</span></a></span><span>    </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BSC</span></span><span>
</span><span id="line-116"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Unsafe.html#"><span class="hs-identifier">Data.ByteString.Unsafe</span></a></span><span>   </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BS</span></span><span>
</span><span id="line-117"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.html#"><span class="hs-identifier">Data.ByteString.Short</span></a></span><span>    </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">SBS</span></span><span>
</span><span id="line-118"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#"><span class="hs-identifier">Data.ByteString.Short.Internal</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">SBS</span></span><span>
</span><span id="line-119"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Foreign.C.html#"><span class="hs-identifier">Foreign.C</span></a></span><span>
</span><span id="line-120"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.html#"><span class="hs-identifier">System.IO</span></a></span><span>
</span><span id="line-121"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Data.html#"><span class="hs-identifier">Data.Data</span></a></span><span>
</span><span id="line-122"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.IORef.html#"><span class="hs-identifier">Data.IORef</span></a></span><span>
</span><span id="line-123"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Char.html#"><span class="hs-identifier">Data.Char</span></a></span><span>
</span><span id="line-124"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.html#"><span class="hs-identifier">Data.Semigroup</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Semi</span></span><span>
</span><span id="line-125"></span><span>
</span><span id="line-126"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Foreign.html#"><span class="hs-identifier">Foreign</span></a></span><span class="hs-cpp">

#if GHC_STAGE &gt;= 2
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.Conc.Sync.html#"><span class="hs-identifier">GHC.Conc.Sync</span></a></span><span>    </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Conc.Sync.html#sharedCAF"><span class="hs-identifier">sharedCAF</span></a></span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &lt; 811
</span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">GHC.Base</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">unpackCString#</span><span class="hs-special">,</span><span class="hs-identifier">unpackNBytes#</span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exts.html#"><span class="hs-identifier">GHC.Exts</span></a></span><span>
</span><span id="line-136"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.html#"><span class="hs-identifier">GHC.IO</span></a></span><span>
</span><span id="line-137"></span><span>
</span><span id="line-138"></span><span class="hs-comment">-- | Gives the UTF-8 encoded bytes corresponding to a 'FastString'</span><span>
</span><span id="line-139"></span><span class="annot"><a href="GHC.Data.FastString.html#bytesFS"><span class="hs-identifier hs-type">bytesFS</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#fastStringToByteString"><span class="hs-identifier hs-type">fastStringToByteString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-140"></span><span id="bytesFS"><span class="annot"><span class="annottext">bytesFS :: FastString -&gt; ByteString
</span><a href="GHC.Data.FastString.html#bytesFS"><span class="hs-identifier hs-var hs-var">bytesFS</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; ByteString
</span><a href="GHC.Data.FastString.html#fastStringToByteString"><span class="hs-identifier hs-var">fastStringToByteString</span></a></span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span class="hs-pragma">{-# DEPRECATED</span><span> </span><span class="hs-pragma">fastStringToByteString</span><span> </span><span class="hs-pragma">&quot;Use `bytesFS` instead&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-143"></span><span id="fastStringToByteString"><span class="annot"><span class="annottext">fastStringToByteString :: FastString -&gt; ByteString
</span><a href="GHC.Data.FastString.html#fastStringToByteString"><span class="hs-identifier hs-var hs-var">fastStringToByteString</span></a></span></span><span> </span><span id="local-6989586621680782224"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782224"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ShortByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#fromShort"><span class="hs-identifier hs-var">SBS.fromShort</span></a></span><span> </span><span class="annot"><span class="annottext">(ShortByteString -&gt; ByteString) -&gt; ShortByteString -&gt; ByteString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; ShortByteString
</span><a href="GHC.Data.FastString.html#fs_sbs"><span class="hs-identifier hs-var hs-var">fs_sbs</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782224"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-144"></span><span>
</span><span id="line-145"></span><span class="annot"><a href="GHC.Data.FastString.html#fastStringToShortByteString"><span class="hs-identifier hs-type">fastStringToShortByteString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#ShortByteString"><span class="hs-identifier hs-type">ShortByteString</span></a></span><span>
</span><span id="line-146"></span><span id="fastStringToShortByteString"><span class="annot"><span class="annottext">fastStringToShortByteString :: FastString -&gt; ShortByteString
</span><a href="GHC.Data.FastString.html#fastStringToShortByteString"><span class="hs-identifier hs-var hs-var">fastStringToShortByteString</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; ShortByteString
</span><a href="GHC.Data.FastString.html#fs_sbs"><span class="hs-identifier hs-var hs-var">fs_sbs</span></a></span><span>
</span><span id="line-147"></span><span>
</span><span id="line-148"></span><span class="annot"><a href="GHC.Data.FastString.html#fastZStringToByteString"><span class="hs-identifier hs-type">fastZStringToByteString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastZString"><span class="hs-identifier hs-type">FastZString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-149"></span><span id="fastZStringToByteString"><span class="annot"><span class="annottext">fastZStringToByteString :: FastZString -&gt; ByteString
</span><a href="GHC.Data.FastString.html#fastZStringToByteString"><span class="hs-identifier hs-var hs-var">fastZStringToByteString</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastString.html#FastZString"><span class="hs-identifier hs-type">FastZString</span></a></span><span> </span><span id="local-6989586621680782220"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680782220"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680782220"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-150"></span><span>
</span><span id="line-151"></span><span class="hs-comment">-- This will drop information if any character &gt; '\xFF'</span><span>
</span><span id="line-152"></span><span class="annot"><a href="GHC.Data.FastString.html#unsafeMkByteString"><span class="hs-identifier hs-type">unsafeMkByteString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-153"></span><span id="unsafeMkByteString"><span class="annot"><span class="annottext">unsafeMkByteString :: String -&gt; ByteString
</span><a href="GHC.Data.FastString.html#unsafeMkByteString"><span class="hs-identifier hs-var hs-var">unsafeMkByteString</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#pack"><span class="hs-identifier hs-var">BSC.pack</span></a></span><span>
</span><span id="line-154"></span><span>
</span><span id="line-155"></span><span class="annot"><a href="GHC.Data.FastString.html#hashFastString"><span class="hs-identifier hs-type">hashFastString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-156"></span><span id="hashFastString"><span class="annot"><span class="annottext">hashFastString :: FastString -&gt; Int
</span><a href="GHC.Data.FastString.html#hashFastString"><span class="hs-identifier hs-var hs-var">hashFastString</span></a></span></span><span> </span><span id="local-6989586621680782217"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782217"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ShortByteString -&gt; Int
</span><a href="GHC.Data.FastString.html#hashStr"><span class="hs-identifier hs-var">hashStr</span></a></span><span> </span><span class="annot"><span class="annottext">(ShortByteString -&gt; Int) -&gt; ShortByteString -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; ShortByteString
</span><a href="GHC.Data.FastString.html#fs_sbs"><span class="hs-identifier hs-var hs-var">fs_sbs</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782217"><span class="hs-identifier hs-var">fs</span></a></span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-159"></span><span>
</span><span id="line-160"></span><span class="hs-keyword">newtype</span><span> </span><span id="FastZString"><span class="annot"><a href="GHC.Data.FastString.html#FastZString"><span class="hs-identifier hs-var">FastZString</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="FastZString"><span class="annot"><a href="GHC.Data.FastString.html#FastZString"><span class="hs-identifier hs-var">FastZString</span></a></span></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-161"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span id="local-6989586621680782214"><span class="annot"><span class="annottext">FastZString -&gt; ()
(FastZString -&gt; ()) -&gt; NFData FastZString
forall a. (a -&gt; ()) -&gt; NFData a
rnf :: FastZString -&gt; ()
$crnf :: FastZString -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#C%3ANFData"><span class="hs-identifier hs-var hs-var hs-var hs-var">NFData</span></a></span></span><span>
</span><span id="line-162"></span><span>
</span><span id="line-163"></span><span class="annot"><a href="GHC.Data.FastString.html#hPutFZS"><span class="hs-identifier hs-type">hPutFZS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastZString"><span class="hs-identifier hs-type">FastZString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-164"></span><span id="hPutFZS"><span class="annot"><span class="annottext">hPutFZS :: Handle -&gt; FastZString -&gt; IO ()
</span><a href="GHC.Data.FastString.html#hPutFZS"><span class="hs-identifier hs-var hs-var">hPutFZS</span></a></span></span><span> </span><span id="local-6989586621680782208"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621680782208"><span class="hs-identifier hs-var">handle</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastString.html#FastZString"><span class="hs-identifier hs-type">FastZString</span></a></span><span> </span><span id="local-6989586621680782207"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680782207"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; ByteString -&gt; IO ()
</span><a href="../../bytestring/src/Data.ByteString.html#hPut"><span class="hs-identifier hs-var">BS.hPut</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621680782208"><span class="hs-identifier hs-var">handle</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680782207"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-165"></span><span>
</span><span id="line-166"></span><span class="annot"><a href="GHC.Data.FastString.html#zString"><span class="hs-identifier hs-type">zString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastZString"><span class="hs-identifier hs-type">FastZString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-167"></span><span id="zString"><span class="annot"><span class="annottext">zString :: FastZString -&gt; String
</span><a href="GHC.Data.FastString.html#zString"><span class="hs-identifier hs-var hs-var">zString</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastString.html#FastZString"><span class="hs-identifier hs-type">FastZString</span></a></span><span> </span><span id="local-6989586621680782205"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680782205"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-168"></span><span>    </span><span class="annot"><span class="annottext">IO String -&gt; String
forall a. IO a -&gt; a
</span><a href="GHC.Utils.IO.Unsafe.html#inlinePerformIO"><span class="hs-identifier hs-var">inlinePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO String -&gt; String) -&gt; IO String -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; (CStringLen -&gt; IO String) -&gt; IO String
forall a. ByteString -&gt; (CStringLen -&gt; IO a) -&gt; IO a
</span><a href="../../bytestring/src/Data.ByteString.Unsafe.html#unsafeUseAsCStringLen"><span class="hs-identifier hs-var">BS.unsafeUseAsCStringLen</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680782205"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="annot"><span class="annottext">CStringLen -&gt; IO String
</span><a href="../../base/src/Foreign.C.String.html#peekCAStringLen"><span class="hs-identifier hs-var">peekCAStringLen</span></a></span><span>
</span><span id="line-169"></span><span>
</span><span id="line-170"></span><span class="annot"><a href="GHC.Data.FastString.html#lengthFZS"><span class="hs-identifier hs-type">lengthFZS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastZString"><span class="hs-identifier hs-type">FastZString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-171"></span><span id="lengthFZS"><span class="annot"><span class="annottext">lengthFZS :: FastZString -&gt; Int
</span><a href="GHC.Data.FastString.html#lengthFZS"><span class="hs-identifier hs-var hs-var">lengthFZS</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastString.html#FastZString"><span class="hs-identifier hs-type">FastZString</span></a></span><span> </span><span id="local-6989586621680782201"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680782201"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Int
</span><a href="../../bytestring/src/Data.ByteString.html#length"><span class="hs-identifier hs-var">BS.length</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680782201"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-172"></span><span>
</span><span id="line-173"></span><span class="annot"><a href="GHC.Data.FastString.html#mkFastZStringString"><span class="hs-identifier hs-type">mkFastZStringString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastZString"><span class="hs-identifier hs-type">FastZString</span></a></span><span>
</span><span id="line-174"></span><span id="mkFastZStringString"><span class="annot"><span class="annottext">mkFastZStringString :: String -&gt; FastZString
</span><a href="GHC.Data.FastString.html#mkFastZStringString"><span class="hs-identifier hs-var hs-var">mkFastZStringString</span></a></span></span><span> </span><span id="local-6989586621680782198"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680782198"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; FastZString
</span><a href="GHC.Data.FastString.html#FastZString"><span class="hs-identifier hs-var">FastZString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.Char8.html#pack"><span class="hs-identifier hs-var">BSC.pack</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680782198"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-175"></span><span>
</span><span id="line-176"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-177"></span><span>
</span><span id="line-178"></span><span class="hs-comment">{-| A 'FastString' is a UTF-8 encoded string together with a unique ID. All
'FastString's are stored in a global hashtable to support fast O(1)
comparison.

It is also associated with a lazy reference to the Z-encoding
of this string which is used by the compiler internally.
-}</span><span>
</span><span id="line-185"></span><span class="hs-keyword">data</span><span> </span><span id="FastString"><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-var">FastString</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="FastString"><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-var">FastString</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-186"></span><span>      </span><span id="uniq"><span class="annot"><span class="annottext">FastString -&gt; Int
</span><a href="GHC.Data.FastString.html#uniq"><span class="hs-identifier hs-var hs-var">uniq</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- unique id</span><span>
</span><span id="line-187"></span><span>      </span><span id="n_chars"><span class="annot"><span class="annottext">FastString -&gt; Int
</span><a href="GHC.Data.FastString.html#n_chars"><span class="hs-identifier hs-var hs-var">n_chars</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- number of chars</span><span>
</span><span id="line-188"></span><span>      </span><span id="fs_sbs"><span class="annot"><span class="annottext">FastString -&gt; ShortByteString
</span><a href="GHC.Data.FastString.html#fs_sbs"><span class="hs-identifier hs-var hs-var">fs_sbs</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#ShortByteString"><span class="hs-identifier hs-type">ShortByteString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-189"></span><span>      </span><span id="fs_zenc"><span class="annot"><span class="annottext">FastString -&gt; FastZString
</span><a href="GHC.Data.FastString.html#fs_zenc"><span class="hs-identifier hs-var hs-var">fs_zenc</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastZString"><span class="hs-identifier hs-type">FastZString</span></a></span><span>
</span><span id="line-190"></span><span>      </span><span class="hs-comment">-- ^ Lazily computed z-encoding of this string.</span><span>
</span><span id="line-191"></span><span>      </span><span class="hs-comment">--</span><span>
</span><span id="line-192"></span><span>      </span><span class="hs-comment">-- Since 'FastString's are globally memoized this is computed at most</span><span>
</span><span id="line-193"></span><span>      </span><span class="hs-comment">-- once for any given string.</span><span>
</span><span id="line-194"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680782191"><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-197"></span><span>  </span><span id="local-6989586621680782188"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782188"><span class="hs-identifier hs-var">f1</span></a></span></span><span> </span><span id="local-6989586621680782187"><span class="annot"><span class="annottext">== :: FastString -&gt; FastString -&gt; Bool
</span><span class="hs-operator hs-var hs-var hs-var hs-var">==</span></span></span><span> </span><span id="local-6989586621680782186"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782186"><span class="hs-identifier hs-var">f2</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">FastString -&gt; Int
</span><a href="GHC.Data.FastString.html#uniq"><span class="hs-identifier hs-var hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782188"><span class="hs-identifier hs-var">f1</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Int
</span><a href="GHC.Data.FastString.html#uniq"><span class="hs-identifier hs-var hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782186"><span class="hs-identifier hs-var">f2</span></a></span><span>
</span><span id="line-198"></span><span>
</span><span id="line-199"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Ord</span></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-200"></span><span>    </span><span class="hs-comment">-- Compares lexicographically, not by unique</span><span>
</span><span id="line-201"></span><span>    </span><span id="local-6989586621680782174"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782174"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621680782173"><span class="annot"><span class="annottext">&lt;= :: FastString -&gt; FastString -&gt; Bool
</span><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;=</span></span></span><span> </span><span id="local-6989586621680782171"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782171"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; Ordering
</span><a href="GHC.Data.FastString.html#cmpFS"><span class="hs-identifier hs-var">cmpFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782174"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782171"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">LT</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">;</span><span>  </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">EQ</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">;</span><span>  </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">GT</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-202"></span><span>    </span><span id="local-6989586621680782169"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782169"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621680782168"><span class="annot"><span class="annottext">&lt; :: FastString -&gt; FastString -&gt; Bool
</span><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;</span></span></span><span>  </span><span id="local-6989586621680782166"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782166"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; Ordering
</span><a href="GHC.Data.FastString.html#cmpFS"><span class="hs-identifier hs-var">cmpFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782169"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782166"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">LT</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">;</span><span>  </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">EQ</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">GT</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-203"></span><span>    </span><span id="local-6989586621680782165"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782165"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621680782164"><span class="annot"><span class="annottext">&gt;= :: FastString -&gt; FastString -&gt; Bool
</span><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;=</span></span></span><span> </span><span id="local-6989586621680782163"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782163"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; Ordering
</span><a href="GHC.Data.FastString.html#cmpFS"><span class="hs-identifier hs-var">cmpFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782165"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782163"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">LT</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">EQ</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">;</span><span>  </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">GT</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-204"></span><span>    </span><span id="local-6989586621680782162"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782162"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621680782161"><span class="annot"><span class="annottext">&gt; :: FastString -&gt; FastString -&gt; Bool
</span><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;</span></span></span><span>  </span><span id="local-6989586621680782159"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782159"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; Ordering
</span><a href="GHC.Data.FastString.html#cmpFS"><span class="hs-identifier hs-var">cmpFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782162"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782159"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">LT</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">EQ</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">GT</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-205"></span><span>    </span><span id="local-6989586621680782157"><span class="annot"><span class="annottext">max :: FastString -&gt; FastString -&gt; FastString
</span><span class="hs-identifier hs-var hs-var hs-var hs-var">max</span></span></span><span> </span><span id="local-6989586621680782155"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782155"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621680782154"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782154"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782155"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782154"><span class="hs-identifier hs-var">y</span></a></span><span>    </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782155"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-206"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782154"><span class="hs-identifier hs-var">y</span></a></span><span>
</span><span id="line-207"></span><span>    </span><span id="local-6989586621680782152"><span class="annot"><span class="annottext">min :: FastString -&gt; FastString -&gt; FastString
</span><span class="hs-identifier hs-var hs-var hs-var hs-var">min</span></span></span><span> </span><span id="local-6989586621680782150"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782150"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621680782149"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782149"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782150"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782149"><span class="hs-identifier hs-var">y</span></a></span><span>    </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782150"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-208"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782149"><span class="hs-identifier hs-var">y</span></a></span><span>
</span><span id="line-209"></span><span>    </span><span id="local-6989586621680782148"><span class="annot"><span class="annottext">compare :: FastString -&gt; FastString -&gt; Ordering
</span><span class="hs-identifier hs-var hs-var hs-var hs-var">compare</span></span></span><span> </span><span id="local-6989586621680782146"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782146"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621680782145"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782145"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; Ordering
</span><a href="GHC.Data.FastString.html#cmpFS"><span class="hs-identifier hs-var">cmpFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782146"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782145"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-210"></span><span>
</span><span id="line-211"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/Data.String.html#IsString"><span class="hs-identifier hs-type">IsString</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-212"></span><span>    </span><span id="local-6989586621680782141"><span class="annot"><span class="annottext">fromString :: String -&gt; FastString
</span><a href="../../base/src/Data.String.html#fromString"><span class="hs-identifier hs-var hs-var hs-var hs-var">fromString</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span>
</span><span id="line-213"></span><span>
</span><span id="line-214"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680782136"><span id="local-6989586621680782138"><span class="annot"><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semi.Semigroup</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-215"></span><span>    </span><span id="local-6989586621680782134"><span class="annot"><span class="annottext">&lt;&gt; :: FastString -&gt; FastString -&gt; FastString
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; FastString
</span><a href="GHC.Data.FastString.html#appendFS"><span class="hs-identifier hs-var">appendFS</span></a></span><span>
</span><span id="line-216"></span><span>
</span><span id="line-217"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-218"></span><span>    </span><span id="local-6989586621680782126"><span class="annot"><span class="annottext">mempty :: FastString
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="GHC.Data.FastString.html#nilFS"><span class="hs-identifier hs-var">nilFS</span></a></span><span>
</span><span id="line-219"></span><span>    </span><span id="local-6989586621680782124"><span class="annot"><span class="annottext">mappend :: FastString -&gt; FastString -&gt; FastString
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var hs-var hs-var hs-var">mappend</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; FastString
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">(Semi.&lt;&gt;)</span></a></span><span>
</span><span id="line-220"></span><span>    </span><span id="local-6989586621680782123"><span class="annot"><span class="annottext">mconcat :: [FastString] -&gt; FastString
</span><a href="../../base/src/GHC.Base.html#mconcat"><span class="hs-identifier hs-var hs-var hs-var hs-var">mconcat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[FastString] -&gt; FastString
</span><a href="GHC.Data.FastString.html#concatFS"><span class="hs-identifier hs-var">concatFS</span></a></span><span>
</span><span id="line-221"></span><span>
</span><span id="line-222"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680782118"><span id="local-6989586621680782121"><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-223"></span><span>   </span><span id="local-6989586621680782112"><span class="annot"><span class="annottext">show :: FastString -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var hs-var hs-var hs-var">show</span></a></span></span><span> </span><span id="local-6989586621680782110"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782110"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ShowS
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; String
</span><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier hs-var">unpackFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782110"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-224"></span><span>
</span><span id="line-225"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621680782083"><span id="local-6989586621680782085"><span id="local-6989586621680782087"><span id="local-6989586621680782089"><span id="local-6989586621680782091"><span id="local-6989586621680782093"><span id="local-6989586621680782095"><span id="local-6989586621680782097"><span id="local-6989586621680782099"><span id="local-6989586621680782101"><span id="local-6989586621680782106"><span class="annot"><a href="../../base/src/Data.Data.html#Data"><span class="hs-identifier hs-type">Data</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span></span></span></span></span></span></span></span></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-226"></span><span>  </span><span class="hs-comment">-- don't traverse?</span><span>
</span><span id="line-227"></span><span>  </span><span id="local-6989586621680782081"><span class="annot"><span class="annottext">toConstr :: FastString -&gt; Constr
</span><a href="../../base/src/Data.Data.html#toConstr"><span class="hs-identifier hs-var hs-var hs-var hs-var">toConstr</span></a></span></span><span> </span><span class="annot"><span class="annottext">FastString
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Constr
</span><a href="GHC.Utils.Misc.html#abstractConstr"><span class="hs-identifier hs-var">abstractConstr</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;FastString&quot;</span></span><span>
</span><span id="line-228"></span><span>  </span><span id="local-6989586621680782076"><span class="annot"><span class="annottext">gunfold :: forall (c :: * -&gt; *).
(forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r)
-&gt; (forall r. r -&gt; c r) -&gt; Constr -&gt; c FastString
</span><a href="../../base/src/Data.Data.html#gunfold"><span class="hs-identifier hs-var hs-var hs-var hs-var">gunfold</span></a></span></span><span> </span><span class="annot"><span class="annottext">forall b r. Data b =&gt; c (b -&gt; r) -&gt; c r
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">forall r. r -&gt; c r
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Constr -&gt; c FastString
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;gunfold&quot;</span></span><span>
</span><span id="line-229"></span><span>  </span><span id="local-6989586621680782073"><span class="annot"><span class="annottext">dataTypeOf :: FastString -&gt; DataType
</span><a href="../../base/src/Data.Data.html#dataTypeOf"><span class="hs-identifier hs-var hs-var hs-var hs-var">dataTypeOf</span></a></span></span><span> </span><span class="annot"><span class="annottext">FastString
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DataType
</span><a href="../../base/src/Data.Data.html#mkNoRepType"><span class="hs-identifier hs-var">mkNoRepType</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;FastString&quot;</span></span><span>
</span><span id="line-230"></span><span>
</span><span id="line-231"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#NFData"><span class="hs-identifier hs-type">NFData</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-232"></span><span>  </span><span id="local-6989586621680782068"><span class="annot"><span class="annottext">rnf :: FastString -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var hs-var hs-var hs-var">rnf</span></a></span></span><span> </span><span id="local-6989586621680782066"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782066"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; () -&gt; ()
</span><span class="hs-identifier hs-var">seq</span></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782066"><span class="hs-identifier hs-var">fs</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-233"></span><span>
</span><span id="line-234"></span><span class="annot"><a href="GHC.Data.FastString.html#cmpFS"><span class="hs-identifier hs-type">cmpFS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Ordering</span></span><span>
</span><span id="line-235"></span><span id="cmpFS"><span class="annot"><span class="annottext">cmpFS :: FastString -&gt; FastString -&gt; Ordering
</span><a href="GHC.Data.FastString.html#cmpFS"><span class="hs-identifier hs-var hs-var">cmpFS</span></a></span></span><span> </span><span id="local-6989586621680782065"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782065"><span class="hs-identifier hs-var">fs1</span></a></span></span><span> </span><span id="local-6989586621680782064"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782064"><span class="hs-identifier hs-var">fs2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-236"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Int
</span><a href="GHC.Data.FastString.html#uniq"><span class="hs-identifier hs-var hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782065"><span class="hs-identifier hs-var">fs1</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Int
</span><a href="GHC.Data.FastString.html#uniq"><span class="hs-identifier hs-var hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782064"><span class="hs-identifier hs-var">fs2</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Ordering
</span><span class="hs-identifier hs-var">EQ</span></span><span> </span><span class="hs-keyword">else</span><span>
</span><span id="line-237"></span><span>  </span><span class="annot"><span class="annottext">ShortByteString -&gt; ShortByteString -&gt; Ordering
forall a. Ord a =&gt; a -&gt; a -&gt; Ordering
</span><span class="hs-identifier hs-var">compare</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; ShortByteString
</span><a href="GHC.Data.FastString.html#fs_sbs"><span class="hs-identifier hs-var hs-var">fs_sbs</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782065"><span class="hs-identifier hs-var">fs1</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; ShortByteString
</span><a href="GHC.Data.FastString.html#fs_sbs"><span class="hs-identifier hs-var hs-var">fs_sbs</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782064"><span class="hs-identifier hs-var">fs2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-238"></span><span>
</span><span id="line-239"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-240"></span><span class="hs-comment">-- Construction</span><span>
</span><span id="line-241"></span><span>
</span><span id="line-242"></span><span class="hs-comment">{-
Internally, the compiler will maintain a fast string symbol table, providing
sharing and fast comparison. Creation of new @FastString@s then covertly does a
lookup, re-using the @FastString@ if there was a hit.

The design of the FastString hash table allows for lockless concurrent reads
and updates to multiple buckets with low synchronization overhead.

See Note [Updating the FastString table] on how it's updated.
-}</span><span>
</span><span id="line-252"></span><span class="hs-keyword">data</span><span> </span><span id="FastStringTable"><span class="annot"><a href="GHC.Data.FastString.html#FastStringTable"><span class="hs-identifier hs-var">FastStringTable</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="FastStringTable"><span class="annot"><a href="GHC.Data.FastString.html#FastStringTable"><span class="hs-identifier hs-var">FastStringTable</span></a></span></span><span>
</span><span id="line-253"></span><span>  </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IORef.html#IORef"><span class="hs-identifier hs-type">IORef</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- the unique ID counter shared with all buckets</span><span>
</span><span id="line-254"></span><span>  </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IORef.html#IORef"><span class="hs-identifier hs-type">IORef</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- number of computed z-encodings for all buckets</span><span>
</span><span id="line-255"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Array#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IORef.html#IORef"><span class="hs-identifier hs-type">IORef</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastStringTableSegment"><span class="hs-identifier hs-type">FastStringTableSegment</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- concurrent segments</span><span>
</span><span id="line-256"></span><span>
</span><span id="line-257"></span><span class="hs-keyword">data</span><span> </span><span id="FastStringTableSegment"><span class="annot"><a href="GHC.Data.FastString.html#FastStringTableSegment"><span class="hs-identifier hs-var">FastStringTableSegment</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="FastStringTableSegment"><span class="annot"><a href="GHC.Data.FastString.html#FastStringTableSegment"><span class="hs-identifier hs-var">FastStringTableSegment</span></a></span></span><span>
</span><span id="line-258"></span><span>  </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.MVar.html#MVar"><span class="hs-identifier hs-type">MVar</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- the lock for write in each segment</span><span>
</span><span id="line-259"></span><span>  </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IORef.html#IORef"><span class="hs-identifier hs-type">IORef</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- the number of elements</span><span>
</span><span id="line-260"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">MutableArray#</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">RealWorld</span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- buckets in this segment</span><span>
</span><span id="line-261"></span><span>
</span><span id="line-262"></span><span class="hs-comment">{-
Following parameters are determined based on:

* Benchmark based on testsuite/tests/utils/should_run/T14854.hs
* Stats of @echo :browse | ghc --interactive -dfaststring-stats &gt;/dev/null@:
  on 2018-10-24, we have 13920 entries.
-}</span><span>
</span><span id="line-269"></span><span class="annot"><a href="GHC.Data.FastString.html#segmentBits"><span class="hs-identifier hs-type">segmentBits</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#numSegments"><span class="hs-identifier hs-type">numSegments</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#segmentMask"><span class="hs-identifier hs-type">segmentMask</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#initialNumBuckets"><span class="hs-identifier hs-type">initialNumBuckets</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-270"></span><span id="segmentBits"><span class="annot"><span class="annottext">segmentBits :: Int
</span><a href="GHC.Data.FastString.html#segmentBits"><span class="hs-identifier hs-var hs-var">segmentBits</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">8</span></span><span>
</span><span id="line-271"></span><span id="numSegments"><span class="annot"><span class="annottext">numSegments :: Int
</span><a href="GHC.Data.FastString.html#numSegments"><span class="hs-identifier hs-var hs-var">numSegments</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">256</span></span><span>   </span><span class="hs-comment">-- bit segmentBits</span><span>
</span><span id="line-272"></span><span id="segmentMask"><span class="annot"><span class="annottext">segmentMask :: Int
</span><a href="GHC.Data.FastString.html#segmentMask"><span class="hs-identifier hs-var hs-var">segmentMask</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0xff</span></span><span>  </span><span class="hs-comment">-- bit segmentBits - 1</span><span>
</span><span id="line-273"></span><span id="initialNumBuckets"><span class="annot"><span class="annottext">initialNumBuckets :: Int
</span><a href="GHC.Data.FastString.html#initialNumBuckets"><span class="hs-identifier hs-var hs-var">initialNumBuckets</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">64</span></span><span>
</span><span id="line-274"></span><span>
</span><span id="line-275"></span><span class="annot"><a href="GHC.Data.FastString.html#hashToSegment%23"><span class="hs-identifier hs-type">hashToSegment#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span>
</span><span id="line-276"></span><span id="hashToSegment%23"><span class="annot"><span class="annottext">hashToSegment# :: Int# -&gt; Int#
</span><a href="GHC.Data.FastString.html#hashToSegment%23"><span class="hs-identifier hs-var hs-var">hashToSegment#</span></a></span></span><span> </span><span id="local-6989586621680782056"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782056"><span class="hs-identifier hs-var">hash#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782056"><span class="hs-identifier hs-var">hash#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`andI#`</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782055"><span class="hs-identifier hs-var">segmentMask#</span></a></span><span>
</span><span id="line-277"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-278"></span><span>    </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680782055"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782055"><span class="hs-identifier hs-var">segmentMask#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Data.FastString.html#segmentMask"><span class="hs-identifier hs-var">segmentMask</span></a></span><span>
</span><span id="line-279"></span><span>
</span><span id="line-280"></span><span class="annot"><a href="GHC.Data.FastString.html#hashToIndex%23"><span class="hs-identifier hs-type">hashToIndex#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">MutableArray#</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">RealWorld</span></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int#</span></span><span>
</span><span id="line-281"></span><span id="hashToIndex%23"><span class="annot"><span class="annottext">hashToIndex# :: MutableArray# RealWorld [FastString] -&gt; Int# -&gt; Int#
</span><a href="GHC.Data.FastString.html#hashToIndex%23"><span class="hs-identifier hs-var hs-var">hashToIndex#</span></a></span></span><span> </span><span id="local-6989586621680782053"><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680782053"><span class="hs-identifier hs-var">buckets#</span></a></span></span><span> </span><span id="local-6989586621680782052"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782052"><span class="hs-identifier hs-var">hash#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-282"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782052"><span class="hs-identifier hs-var">hash#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`uncheckedIShiftRL#`</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782051"><span class="hs-identifier hs-var">segmentBits#</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`remInt#`</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782050"><span class="hs-identifier hs-var">size#</span></a></span><span>
</span><span id="line-283"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-284"></span><span>    </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680782051"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782051"><span class="hs-identifier hs-var">segmentBits#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Data.FastString.html#segmentBits"><span class="hs-identifier hs-var">segmentBits</span></a></span><span>
</span><span id="line-285"></span><span>    </span><span id="local-6989586621680782050"><span class="annot"><span class="annottext">size# :: Int#
</span><a href="#local-6989586621680782050"><span class="hs-identifier hs-var hs-var">size#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString] -&gt; Int#
forall d a. MutableArray# d a -&gt; Int#
</span><span class="hs-identifier hs-var">sizeofMutableArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680782053"><span class="hs-identifier hs-var">buckets#</span></a></span><span>
</span><span id="line-286"></span><span>
</span><span id="line-287"></span><span class="annot"><a href="GHC.Data.FastString.html#maybeResizeSegment"><span class="hs-identifier hs-type">maybeResizeSegment</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IORef.html#IORef"><span class="hs-identifier hs-type">IORef</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastStringTableSegment"><span class="hs-identifier hs-type">FastStringTableSegment</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastStringTableSegment"><span class="hs-identifier hs-type">FastStringTableSegment</span></a></span><span>
</span><span id="line-288"></span><span id="maybeResizeSegment"><span class="annot"><span class="annottext">maybeResizeSegment :: IORef FastStringTableSegment -&gt; IO FastStringTableSegment
</span><a href="GHC.Data.FastString.html#maybeResizeSegment"><span class="hs-identifier hs-var hs-var">maybeResizeSegment</span></a></span></span><span> </span><span id="local-6989586621680782048"><span class="annot"><span class="annottext">IORef FastStringTableSegment
</span><a href="#local-6989586621680782048"><span class="hs-identifier hs-var">segmentRef</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-289"></span><span>  </span><span id="local-6989586621680782047"><span class="annot"><span class="annottext">segment :: FastStringTableSegment
</span><a href="#local-6989586621680782047"><span class="hs-identifier hs-var">segment</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastString.html#FastStringTableSegment"><span class="hs-identifier hs-type">FastStringTableSegment</span></a></span><span> </span><span id="local-6989586621680782046"><span class="annot"><span class="annottext">MVar ()
</span><a href="#local-6989586621680782046"><span class="hs-identifier hs-var">lock</span></a></span></span><span> </span><span id="local-6989586621680782045"><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680782045"><span class="hs-identifier hs-var">counter</span></a></span></span><span> </span><span id="local-6989586621680782044"><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680782044"><span class="hs-identifier hs-var">old#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef FastStringTableSegment -&gt; IO FastStringTableSegment
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="annot"><span class="annottext">IORef FastStringTableSegment
</span><a href="#local-6989586621680782048"><span class="hs-identifier hs-var">segmentRef</span></a></span><span>
</span><span id="line-290"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680782042"><span class="annot"><span class="annottext">oldSize# :: Int#
</span><a href="#local-6989586621680782042"><span class="hs-identifier hs-var hs-var">oldSize#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString] -&gt; Int#
forall d a. MutableArray# d a -&gt; Int#
</span><span class="hs-identifier hs-var">sizeofMutableArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680782044"><span class="hs-identifier hs-var">old#</span></a></span><span>
</span><span id="line-291"></span><span>      </span><span id="local-6989586621680782041"><span class="annot"><span class="annottext">newSize# :: Int#
</span><a href="#local-6989586621680782041"><span class="hs-identifier hs-var hs-var">newSize#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782042"><span class="hs-identifier hs-var">oldSize#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">*#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">2#</span></span><span>
</span><span id="line-292"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680782040"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782040"><span class="hs-identifier hs-var">n#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef Int -&gt; IO Int
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680782045"><span class="hs-identifier hs-var">counter</span></a></span><span>
</span><span id="line-293"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><span class="hs-identifier hs-var">isTrue#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782040"><span class="hs-identifier hs-var">n#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">&lt;#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782041"><span class="hs-identifier hs-var">newSize#</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- maximum load of 1</span><span>
</span><span id="line-294"></span><span>  </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">FastStringTableSegment -&gt; IO FastStringTableSegment
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">FastStringTableSegment
</span><a href="#local-6989586621680782047"><span class="hs-identifier hs-var">segment</span></a></span><span>
</span><span id="line-295"></span><span>  </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-296"></span><span>    </span><span id="local-6989586621680782038"><span class="annot"><span class="annottext">resizedSegment :: FastStringTableSegment
</span><a href="#local-6989586621680782038"><span class="hs-identifier hs-var">resizedSegment</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastString.html#FastStringTableSegment"><span class="hs-identifier hs-type">FastStringTableSegment</span></a></span><span> </span><span class="annot"><span class="annottext">MVar ()
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">IORef Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680782037"><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680782037"><span class="hs-identifier hs-var">new#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld
 -&gt; (# State# RealWorld, FastStringTableSegment #))
-&gt; IO FastStringTableSegment
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld
  -&gt; (# State# RealWorld, FastStringTableSegment #))
 -&gt; IO FastStringTableSegment)
-&gt; (State# RealWorld
    -&gt; (# State# RealWorld, FastStringTableSegment #))
-&gt; IO FastStringTableSegment
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680782036"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782036"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-297"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int#
-&gt; [FastString]
-&gt; State# RealWorld
-&gt; (# State# RealWorld, MutableArray# RealWorld [FastString] #)
forall a d.
Int# -&gt; a -&gt; State# d -&gt; (# State# d, MutableArray# d a #)
</span><span class="hs-identifier hs-var">newArray#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782041"><span class="hs-identifier hs-var">newSize#</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782036"><span class="hs-identifier hs-var">s1#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-298"></span><span>        </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680782035"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782035"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680782034"><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680782034"><span class="hs-identifier hs-var">arr#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782035"><span class="hs-identifier hs-var">s2#</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">MVar ()
-&gt; IORef Int
-&gt; MutableArray# RealWorld [FastString]
-&gt; FastStringTableSegment
</span><a href="GHC.Data.FastString.html#FastStringTableSegment"><span class="hs-identifier hs-var">FastStringTableSegment</span></a></span><span> </span><span class="annot"><span class="annottext">MVar ()
</span><a href="#local-6989586621680782046"><span class="hs-identifier hs-var">lock</span></a></span><span> </span><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680782045"><span class="hs-identifier hs-var">counter</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680782034"><span class="hs-identifier hs-var">arr#</span></a></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-299"></span><span>    </span><span class="annot"><span class="annottext">[Int] -&gt; (Int -&gt; IO ()) -&gt; IO ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#forM_"><span class="hs-identifier hs-var">forM_</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">..</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><span class="hs-identifier hs-var">I#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782042"><span class="hs-identifier hs-var">oldSize#</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">((Int -&gt; IO ()) -&gt; IO ()) -&gt; (Int -&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680782032"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782032"><span class="hs-identifier hs-var">i#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-300"></span><span>      </span><span id="local-6989586621680782031"><span class="annot"><span class="annottext">[FastString]
</span><a href="#local-6989586621680782031"><span class="hs-identifier hs-var">fsList</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, [FastString] #))
-&gt; IO [FastString]
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, [FastString] #))
 -&gt; IO [FastString])
-&gt; (State# RealWorld -&gt; (# State# RealWorld, [FastString] #))
-&gt; IO [FastString]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
-&gt; Int# -&gt; State# RealWorld -&gt; (# State# RealWorld, [FastString] #)
forall d a.
MutableArray# d a -&gt; Int# -&gt; State# d -&gt; (# State# d, a #)
</span><span class="hs-identifier hs-var">readArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680782044"><span class="hs-identifier hs-var">old#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782032"><span class="hs-identifier hs-var">i#</span></a></span><span>
</span><span id="line-301"></span><span>      </span><span class="annot"><span class="annottext">[FastString] -&gt; (FastString -&gt; IO ()) -&gt; IO ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#forM_"><span class="hs-identifier hs-var">forM_</span></a></span><span> </span><span class="annot"><span class="annottext">[FastString]
</span><a href="#local-6989586621680782031"><span class="hs-identifier hs-var">fsList</span></a></span><span> </span><span class="annot"><span class="annottext">((FastString -&gt; IO ()) -&gt; IO ()) -&gt; (FastString -&gt; IO ()) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680782030"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782030"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-302"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span class="hs-comment">-- Shall we store in hash value in FastString instead?</span><span>
</span><span id="line-303"></span><span>            </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680782029"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782029"><span class="hs-identifier hs-var">hash#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Int
</span><a href="GHC.Data.FastString.html#hashFastString"><span class="hs-identifier hs-var">hashFastString</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782030"><span class="hs-identifier hs-var">fs</span></a></span><span>
</span><span id="line-304"></span><span>            </span><span id="local-6989586621680782028"><span class="annot"><span class="annottext">idx# :: Int#
</span><a href="#local-6989586621680782028"><span class="hs-identifier hs-var hs-var">idx#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString] -&gt; Int# -&gt; Int#
</span><a href="GHC.Data.FastString.html#hashToIndex%23"><span class="hs-identifier hs-var">hashToIndex#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680782037"><span class="hs-identifier hs-var">new#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782029"><span class="hs-identifier hs-var">hash#</span></a></span><span>
</span><span id="line-305"></span><span>        </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ()
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ())
-&gt; (State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680782027"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782027"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-306"></span><span>          </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
-&gt; Int# -&gt; State# RealWorld -&gt; (# State# RealWorld, [FastString] #)
forall d a.
MutableArray# d a -&gt; Int# -&gt; State# d -&gt; (# State# d, a #)
</span><span class="hs-identifier hs-var">readArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680782037"><span class="hs-identifier hs-var">new#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782028"><span class="hs-identifier hs-var">idx#</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782027"><span class="hs-identifier hs-var">s1#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-307"></span><span>            </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680782026"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782026"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680782025"><span class="annot"><span class="annottext">[FastString]
</span><a href="#local-6989586621680782025"><span class="hs-identifier hs-var">bucket</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
-&gt; Int# -&gt; [FastString] -&gt; State# RealWorld -&gt; State# RealWorld
forall d a. MutableArray# d a -&gt; Int# -&gt; a -&gt; State# d -&gt; State# d
</span><span class="hs-identifier hs-var">writeArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680782037"><span class="hs-identifier hs-var">new#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782028"><span class="hs-identifier hs-var">idx#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680782030"><span class="hs-identifier hs-var">fs</span></a></span><span class="annot"><span class="annottext">FastString -&gt; [FastString] -&gt; [FastString]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[FastString]
</span><a href="#local-6989586621680782025"><span class="hs-identifier hs-var">bucket</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782026"><span class="hs-identifier hs-var">s2#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-308"></span><span>              </span><span id="local-6989586621680782024"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782024"><span class="hs-identifier hs-var">s3#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782024"><span class="hs-identifier hs-var">s3#</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-309"></span><span>    </span><span class="annot"><span class="annottext">IORef FastStringTableSegment -&gt; FastStringTableSegment -&gt; IO ()
forall a. IORef a -&gt; a -&gt; IO ()
</span><a href="../../base/src/GHC.IORef.html#writeIORef"><span class="hs-identifier hs-var">writeIORef</span></a></span><span> </span><span class="annot"><span class="annottext">IORef FastStringTableSegment
</span><a href="#local-6989586621680782048"><span class="hs-identifier hs-var">segmentRef</span></a></span><span> </span><span class="annot"><span class="annottext">FastStringTableSegment
</span><a href="#local-6989586621680782038"><span class="hs-identifier hs-var">resizedSegment</span></a></span><span>
</span><span id="line-310"></span><span>    </span><span class="annot"><span class="annottext">FastStringTableSegment -&gt; IO FastStringTableSegment
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">FastStringTableSegment
</span><a href="#local-6989586621680782038"><span class="hs-identifier hs-var">resizedSegment</span></a></span><span>
</span><span id="line-311"></span><span>
</span><span id="line-312"></span><span class="hs-pragma">{-# NOINLINE</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#stringTable"><span class="hs-pragma hs-type">stringTable</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-313"></span><span class="annot"><a href="GHC.Data.FastString.html#stringTable"><span class="hs-identifier hs-type">stringTable</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastStringTable"><span class="hs-identifier hs-type">FastStringTable</span></a></span><span>
</span><span id="line-314"></span><span id="stringTable"><span class="annot"><span class="annottext">stringTable :: FastStringTable
</span><a href="GHC.Data.FastString.html#stringTable"><span class="hs-identifier hs-var hs-var">stringTable</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO FastStringTable -&gt; FastStringTable
forall a. IO a -&gt; a
</span><a href="../../base/src/GHC.IO.Unsafe.html#unsafePerformIO"><span class="hs-identifier hs-var">unsafePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO FastStringTable -&gt; FastStringTable)
-&gt; IO FastStringTable -&gt; FastStringTable
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-315"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680782020"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782020"><span class="hs-identifier hs-var">numSegments#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Data.FastString.html#numSegments"><span class="hs-identifier hs-var">numSegments</span></a></span><span>
</span><span id="line-316"></span><span>      </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680782019"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782019"><span class="hs-identifier hs-var">initialNumBuckets#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Data.FastString.html#initialNumBuckets"><span class="hs-identifier hs-var">initialNumBuckets</span></a></span><span>
</span><span id="line-317"></span><span>      </span><span id="local-6989586621680782017"><span class="annot"><span class="annottext">loop :: MutableArray# RealWorld (IORef FastStringTableSegment)
-&gt; Int# -&gt; State# RealWorld -&gt; State# RealWorld
</span><a href="#local-6989586621680782017"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span id="local-6989586621680782016"><span class="annot"><span class="annottext">MutableArray# RealWorld (IORef FastStringTableSegment)
</span><a href="#local-6989586621680782016"><span class="hs-identifier hs-var">a#</span></a></span></span><span> </span><span id="local-6989586621680782015"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782015"><span class="hs-identifier hs-var">i#</span></a></span></span><span> </span><span id="local-6989586621680782014"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782014"><span class="hs-identifier hs-var">s1#</span></a></span></span><span>
</span><span id="line-318"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><span class="hs-identifier hs-var">isTrue#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782015"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">==#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782020"><span class="hs-identifier hs-var">numSegments#</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782014"><span class="hs-identifier hs-var">s1#</span></a></span><span>
</span><span id="line-319"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO (MVar ())
forall a. a -&gt; IO (MVar a)
</span><a href="../../base/src/GHC.MVar.html#newMVar"><span class="hs-identifier hs-var">newMVar</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IO (MVar ()) -&gt; State# RealWorld -&gt; (# State# RealWorld, MVar () #)
forall a. IO a -&gt; State# RealWorld -&gt; (# State# RealWorld, a #)
</span><a href="../../base/src/GHC.Base.html#unIO"><span class="hs-operator hs-var">`unIO`</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782014"><span class="hs-identifier hs-var">s1#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-320"></span><span>            </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680782011"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782011"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680782010"><span class="annot"><span class="annottext">MVar ()
</span><a href="#local-6989586621680782010"><span class="hs-identifier hs-var">lock</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int -&gt; IO (IORef Int)
forall a. a -&gt; IO (IORef a)
</span><a href="../../base/src/GHC.IORef.html#newIORef"><span class="hs-identifier hs-var">newIORef</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">IO (IORef Int)
-&gt; State# RealWorld -&gt; (# State# RealWorld, IORef Int #)
forall a. IO a -&gt; State# RealWorld -&gt; (# State# RealWorld, a #)
</span><a href="../../base/src/GHC.Base.html#unIO"><span class="hs-operator hs-var">`unIO`</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782011"><span class="hs-identifier hs-var">s2#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-321"></span><span>              </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680782008"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782008"><span class="hs-identifier hs-var">s3#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680782007"><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680782007"><span class="hs-identifier hs-var">counter</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int#
-&gt; [FastString]
-&gt; State# RealWorld
-&gt; (# State# RealWorld, MutableArray# RealWorld [FastString] #)
forall a d.
Int# -&gt; a -&gt; State# d -&gt; (# State# d, MutableArray# d a #)
</span><span class="hs-identifier hs-var">newArray#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782019"><span class="hs-identifier hs-var">initialNumBuckets#</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782008"><span class="hs-identifier hs-var">s3#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-322"></span><span>                </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680782006"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782006"><span class="hs-identifier hs-var">s4#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680782005"><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680782005"><span class="hs-identifier hs-var">buckets#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FastStringTableSegment -&gt; IO (IORef FastStringTableSegment)
forall a. a -&gt; IO (IORef a)
</span><a href="../../base/src/GHC.IORef.html#newIORef"><span class="hs-identifier hs-var">newIORef</span></a></span><span>
</span><span id="line-323"></span><span>                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MVar ()
-&gt; IORef Int
-&gt; MutableArray# RealWorld [FastString]
-&gt; FastStringTableSegment
</span><a href="GHC.Data.FastString.html#FastStringTableSegment"><span class="hs-identifier hs-var">FastStringTableSegment</span></a></span><span> </span><span class="annot"><span class="annottext">MVar ()
</span><a href="#local-6989586621680782010"><span class="hs-identifier hs-var">lock</span></a></span><span> </span><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680782007"><span class="hs-identifier hs-var">counter</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680782005"><span class="hs-identifier hs-var">buckets#</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IO (IORef FastStringTableSegment)
-&gt; State# RealWorld
-&gt; (# State# RealWorld, IORef FastStringTableSegment #)
forall a. IO a -&gt; State# RealWorld -&gt; (# State# RealWorld, a #)
</span><a href="../../base/src/GHC.Base.html#unIO"><span class="hs-operator hs-var">`unIO`</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782006"><span class="hs-identifier hs-var">s4#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-324"></span><span>                  </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680782004"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782004"><span class="hs-identifier hs-var">s5#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680782003"><span class="annot"><span class="annottext">IORef FastStringTableSegment
</span><a href="#local-6989586621680782003"><span class="hs-identifier hs-var">segment</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld (IORef FastStringTableSegment)
-&gt; Int#
-&gt; IORef FastStringTableSegment
-&gt; State# RealWorld
-&gt; State# RealWorld
forall d a. MutableArray# d a -&gt; Int# -&gt; a -&gt; State# d -&gt; State# d
</span><span class="hs-identifier hs-var">writeArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld (IORef FastStringTableSegment)
</span><a href="#local-6989586621680782016"><span class="hs-identifier hs-var">a#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782015"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">IORef FastStringTableSegment
</span><a href="#local-6989586621680782003"><span class="hs-identifier hs-var">segment</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782004"><span class="hs-identifier hs-var">s5#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-325"></span><span>                    </span><span id="local-6989586621680782002"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782002"><span class="hs-identifier hs-var">s6#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld (IORef FastStringTableSegment)
-&gt; Int# -&gt; State# RealWorld -&gt; State# RealWorld
</span><a href="#local-6989586621680782017"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld (IORef FastStringTableSegment)
</span><a href="#local-6989586621680782016"><span class="hs-identifier hs-var">a#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782015"><span class="hs-identifier hs-var">i#</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">+#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680782002"><span class="hs-identifier hs-var">s6#</span></a></span><span>
</span><span id="line-326"></span><span>  </span><span id="local-6989586621680782001"><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680782001"><span class="hs-identifier hs-var">uid</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; IO (IORef Int)
forall a. a -&gt; IO (IORef a)
</span><a href="../../base/src/GHC.IORef.html#newIORef"><span class="hs-identifier hs-var">newIORef</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">603979776</span></span><span> </span><span class="hs-comment">-- ord '$' * 0x01000000</span><span>
</span><span id="line-327"></span><span>  </span><span id="local-6989586621680782000"><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680782000"><span class="hs-identifier hs-var">n_zencs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; IO (IORef Int)
forall a. a -&gt; IO (IORef a)
</span><a href="../../base/src/GHC.IORef.html#newIORef"><span class="hs-identifier hs-var">newIORef</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-328"></span><span>  </span><span id="local-6989586621680781999"><span class="annot"><span class="annottext">FastStringTable
</span><a href="#local-6989586621680781999"><span class="hs-identifier hs-var">tab</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, FastStringTable #))
-&gt; IO FastStringTable
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, FastStringTable #))
 -&gt; IO FastStringTable)
-&gt; (State# RealWorld -&gt; (# State# RealWorld, FastStringTable #))
-&gt; IO FastStringTable
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680781998"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781998"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-329"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int#
-&gt; IORef FastStringTableSegment
-&gt; State# RealWorld
-&gt; (# State# RealWorld,
      MutableArray# RealWorld (IORef FastStringTableSegment) #)
forall a d.
Int# -&gt; a -&gt; State# d -&gt; (# State# d, MutableArray# d a #)
</span><span class="hs-identifier hs-var">newArray#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680782020"><span class="hs-identifier hs-var">numSegments#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; IORef FastStringTableSegment
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;string_table&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781998"><span class="hs-identifier hs-var">s1#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-330"></span><span>      </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680781996"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781996"><span class="hs-identifier hs-var">s2#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680781995"><span class="annot"><span class="annottext">MutableArray# RealWorld (IORef FastStringTableSegment)
</span><a href="#local-6989586621680781995"><span class="hs-identifier hs-var">arr#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld (IORef FastStringTableSegment)
-&gt; Int# -&gt; State# RealWorld -&gt; State# RealWorld
</span><a href="#local-6989586621680782017"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld (IORef FastStringTableSegment)
</span><a href="#local-6989586621680781995"><span class="hs-identifier hs-var">arr#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781996"><span class="hs-identifier hs-var">s2#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-331"></span><span>        </span><span id="local-6989586621680781994"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781994"><span class="hs-identifier hs-var">s3#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld (IORef FastStringTableSegment)
-&gt; State# RealWorld
-&gt; (# State# RealWorld, Array# (IORef FastStringTableSegment) #)
forall d a.
MutableArray# d a -&gt; State# d -&gt; (# State# d, Array# a #)
</span><span class="hs-identifier hs-var">unsafeFreezeArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld (IORef FastStringTableSegment)
</span><a href="#local-6989586621680781995"><span class="hs-identifier hs-var">arr#</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781994"><span class="hs-identifier hs-var">s3#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-332"></span><span>          </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680781993"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781993"><span class="hs-identifier hs-var">s4#</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680781992"><span class="annot"><span class="annottext">Array# (IORef FastStringTableSegment)
</span><a href="#local-6989586621680781992"><span class="hs-identifier hs-var">segments#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-333"></span><span>            </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781993"><span class="hs-identifier hs-var">s4#</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">IORef Int
-&gt; IORef Int
-&gt; Array# (IORef FastStringTableSegment)
-&gt; FastStringTable
</span><a href="GHC.Data.FastString.html#FastStringTable"><span class="hs-identifier hs-var">FastStringTable</span></a></span><span> </span><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680782001"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680782000"><span class="hs-identifier hs-var">n_zencs</span></a></span><span> </span><span class="annot"><span class="annottext">Array# (IORef FastStringTableSegment)
</span><a href="#local-6989586621680781992"><span class="hs-identifier hs-var">segments#</span></a></span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-334"></span><span>
</span><span id="line-335"></span><span>  </span><span class="hs-comment">-- use the support wired into the RTS to share this CAF among all images of</span><span>
</span><span id="line-336"></span><span>  </span><span class="hs-comment">-- libHSghc</span><span class="hs-cpp">
#if GHC_STAGE &lt; 2
</span><span>  </span><span class="hs-identifier">return</span><span> </span><span class="hs-identifier">tab</span><span class="hs-cpp">
#else
</span><span>  </span><span class="annot"><span class="annottext">FastStringTable
-&gt; (Ptr FastStringTable -&gt; IO (Ptr FastStringTable))
-&gt; IO FastStringTable
forall a. a -&gt; (Ptr a -&gt; IO (Ptr a)) -&gt; IO a
</span><a href="../../base/src/GHC.Conc.Sync.html#sharedCAF"><span class="hs-identifier hs-var">sharedCAF</span></a></span><span> </span><span class="annot"><span class="annottext">FastStringTable
</span><a href="#local-6989586621680781999"><span class="hs-identifier hs-var">tab</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr FastStringTable -&gt; IO (Ptr FastStringTable)
forall a. Ptr a -&gt; IO (Ptr a)
</span><a href="GHC.Data.FastString.html#getOrSetLibHSghcFastStringTable"><span class="hs-identifier hs-var">getOrSetLibHSghcFastStringTable</span></a></span><span>
</span><span id="line-341"></span><span>
</span><span id="line-342"></span><span class="hs-comment">-- from the RTS; thus we cannot use this mechanism when GHC_STAGE&lt;2; the previous</span><span>
</span><span id="line-343"></span><span class="hs-comment">-- RTS might not have this symbol</span><span>
</span><span id="line-344"></span><span id="local-6989586621680782398"><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-keyword">ccall</span></span><span> </span><span class="annot"><span class="hs-keyword">unsafe</span></span><span> </span><span class="annot"><span class="hs-string">&quot;getOrSetLibHSghcFastStringTable&quot;</span></span><span>
</span><span id="line-345"></span><span>  </span><span id="getOrSetLibHSghcFastStringTable"><span class="annot"><a href="GHC.Data.FastString.html#getOrSetLibHSghcFastStringTable"><span class="hs-identifier hs-var">getOrSetLibHSghcFastStringTable</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680782398"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680782398"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-348"></span><span class="hs-comment">{-

We include the FastString table in the `sharedCAF` mechanism because we'd like
FastStrings created by a Core plugin to have the same uniques as corresponding
strings created by the host compiler itself.  For example, this allows plugins
to lookup known names (eg `mkTcOcc &quot;MySpecialType&quot;`) in the GlobalRdrEnv or
even re-invoke the parser.

In particular, the following little sanity test was failing in a plugin
prototyping safe newtype-coercions: GHC.NT.Type.NT was imported, but could not
be looked up /by the plugin/.

   let rdrName = mkModuleName &quot;GHC.NT.Type&quot; `mkRdrQual` mkTcOcc &quot;NT&quot;
   putMsgS $ showSDoc dflags $ ppr $ lookupGRE_RdrName rdrName $ mg_rdr_env guts

`mkTcOcc` involves the lookup (or creation) of a FastString.  Since the
plugin's FastString.string_table is empty, constructing the RdrName also
allocates new uniques for the FastStrings &quot;GHC.NT.Type&quot; and &quot;NT&quot;.  These
uniques are almost certainly unequal to the ones that the host compiler
originally assigned to those FastStrings.  Thus the lookup fails since the
domain of the GlobalRdrEnv is affected by the RdrName's OccName's FastString's
unique.

Maintaining synchronization of the two instances of this global is rather
difficult because of the uses of `unsafePerformIO` in this module.  Not
synchronizing them risks breaking the rather major invariant that two
FastStrings with the same unique have the same string. Thus we use the
lower-level `sharedCAF` mechanism that relies on Globals.c.

-}</span><span>
</span><span id="line-378"></span><span>
</span><span id="line-379"></span><span class="annot"><a href="GHC.Data.FastString.html#mkFastString%23"><span class="hs-identifier hs-type">mkFastString#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Addr#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-380"></span><span id="mkFastString%23"><span class="annot"><span class="annottext">mkFastString# :: Addr# -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString%23"><span class="hs-identifier hs-var hs-var">mkFastString#</span></a></span></span><span> </span><span id="local-6989586621680781990"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680781990"><span class="hs-identifier hs-var">a#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastStringBytes"><span class="hs-identifier hs-var">mkFastStringBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8
forall {a}. Ptr a
</span><a href="#local-6989586621680781989"><span class="hs-identifier hs-var">ptr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int
</span><a href="GHC.Data.FastString.html#ptrStrLength"><span class="hs-identifier hs-var">ptrStrLength</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8
forall {a}. Ptr a
</span><a href="#local-6989586621680781989"><span class="hs-identifier hs-var">ptr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-381"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621680781989"><span class="annot"><span class="annottext">ptr :: Ptr a
</span><a href="#local-6989586621680781989"><span class="hs-identifier hs-var hs-var">ptr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Addr# -&gt; Ptr a
forall a. Addr# -&gt; Ptr a
</span><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-var">Ptr</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680781990"><span class="hs-identifier hs-var">a#</span></a></span><span>
</span><span id="line-382"></span><span>
</span><span id="line-383"></span><span class="hs-comment">{- Note [Updating the FastString table]

We use a concurrent hashtable which contains multiple segments, each hash value
always maps to the same segment. Read is lock-free, write to the a segment
should acquire a lock for that segment to avoid race condition, writes to
different segments are independent.

The procedure goes like this:

1. Find out which segment to operate on based on the hash value
2. Read the relevant bucket and perform a look up of the string.
3. If it exists, return it.
4. Otherwise grab a unique ID, create a new FastString and atomically attempt
   to update the relevant segment with this FastString:

   * Resize the segment by doubling the number of buckets when the number of
     FastStrings in this segment grows beyond the threshold.
   * Double check that the string is not in the bucket. Another thread may have
     inserted it while we were creating our string.
   * Return the existing FastString if it exists. The one we preemptively
     created will get GCed.
   * Otherwise, insert and return the string we created.
-}</span><span>
</span><span id="line-406"></span><span>
</span><span id="line-407"></span><span class="annot"><a href="GHC.Data.FastString.html#mkFastStringWith"><span class="hs-identifier hs-type">mkFastStringWith</span></a></span><span>
</span><span id="line-408"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IORef.html#IORef"><span class="hs-identifier hs-type">IORef</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#ShortByteString"><span class="hs-identifier hs-type">ShortByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-409"></span><span id="mkFastStringWith"><span class="annot"><span class="annottext">mkFastStringWith :: (Int -&gt; IORef Int -&gt; IO FastString)
-&gt; ShortByteString -&gt; IO FastString
</span><a href="GHC.Data.FastString.html#mkFastStringWith"><span class="hs-identifier hs-var hs-var">mkFastStringWith</span></a></span></span><span> </span><span id="local-6989586621680781985"><span class="annot"><span class="annottext">Int -&gt; IORef Int -&gt; IO FastString
</span><a href="#local-6989586621680781985"><span class="hs-identifier hs-var">mk_fs</span></a></span></span><span> </span><span id="local-6989586621680781984"><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781984"><span class="hs-identifier hs-var">sbs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-410"></span><span>  </span><span class="annot"><a href="GHC.Data.FastString.html#FastStringTableSegment"><span class="hs-identifier hs-type">FastStringTableSegment</span></a></span><span> </span><span id="local-6989586621680781983"><span class="annot"><span class="annottext">MVar ()
</span><a href="#local-6989586621680781983"><span class="hs-identifier hs-var">lock</span></a></span></span><span> </span><span class="annot"><span class="annottext">IORef Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680781982"><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680781982"><span class="hs-identifier hs-var">buckets#</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef FastStringTableSegment -&gt; IO FastStringTableSegment
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="annot"><span class="annottext">IORef FastStringTableSegment
</span><a href="#local-6989586621680781981"><span class="hs-identifier hs-var">segmentRef</span></a></span><span>
</span><span id="line-411"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680781980"><span class="annot"><span class="annottext">idx# :: Int#
</span><a href="#local-6989586621680781980"><span class="hs-identifier hs-var hs-var">idx#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString] -&gt; Int# -&gt; Int#
</span><a href="GHC.Data.FastString.html#hashToIndex%23"><span class="hs-identifier hs-var">hashToIndex#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680781982"><span class="hs-identifier hs-var">buckets#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781979"><span class="hs-identifier hs-var">hash#</span></a></span><span>
</span><span id="line-412"></span><span>  </span><span id="local-6989586621680781978"><span class="annot"><span class="annottext">[FastString]
</span><a href="#local-6989586621680781978"><span class="hs-identifier hs-var">bucket</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, [FastString] #))
-&gt; IO [FastString]
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, [FastString] #))
 -&gt; IO [FastString])
-&gt; (State# RealWorld -&gt; (# State# RealWorld, [FastString] #))
-&gt; IO [FastString]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
-&gt; Int# -&gt; State# RealWorld -&gt; (# State# RealWorld, [FastString] #)
forall d a.
MutableArray# d a -&gt; Int# -&gt; State# d -&gt; (# State# d, a #)
</span><span class="hs-identifier hs-var">readArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680781982"><span class="hs-identifier hs-var">buckets#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781980"><span class="hs-identifier hs-var">idx#</span></a></span><span>
</span><span id="line-413"></span><span>  </span><span id="local-6989586621680781977"><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621680781977"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[FastString] -&gt; ShortByteString -&gt; IO (Maybe FastString)
</span><a href="GHC.Data.FastString.html#bucket_match"><span class="hs-identifier hs-var">bucket_match</span></a></span><span> </span><span class="annot"><span class="annottext">[FastString]
</span><a href="#local-6989586621680781978"><span class="hs-identifier hs-var">bucket</span></a></span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781984"><span class="hs-identifier hs-var">sbs</span></a></span><span>
</span><span id="line-414"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621680781977"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-415"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680781975"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781975"><span class="hs-identifier hs-var">found</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; IO FastString
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781975"><span class="hs-identifier hs-var">found</span></a></span><span>
</span><span id="line-416"></span><span>    </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-417"></span><span>      </span><span class="hs-comment">-- The withMVar below is not dupable. It can lead to deadlock if it is</span><span>
</span><span id="line-418"></span><span>      </span><span class="hs-comment">-- only run partially and putMVar is not called after takeMVar.</span><span>
</span><span id="line-419"></span><span>      </span><span class="annot"><span class="annottext">IO ()
</span><a href="../../base/src/GHC.IO.Unsafe.html#noDuplicate"><span class="hs-identifier hs-var">noDuplicate</span></a></span><span>
</span><span id="line-420"></span><span>      </span><span id="local-6989586621680781973"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781973"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO Int
</span><a href="#local-6989586621680781972"><span class="hs-identifier hs-var">get_uid</span></a></span><span>
</span><span id="line-421"></span><span>      </span><span id="local-6989586621680781971"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781971"><span class="hs-identifier hs-var">new_fs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; IORef Int -&gt; IO FastString
</span><a href="#local-6989586621680781985"><span class="hs-identifier hs-var">mk_fs</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781973"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680781970"><span class="hs-identifier hs-var">n_zencs</span></a></span><span>
</span><span id="line-422"></span><span>      </span><span class="annot"><span class="annottext">MVar () -&gt; (() -&gt; IO FastString) -&gt; IO FastString
forall a b. MVar a -&gt; (a -&gt; IO b) -&gt; IO b
</span><a href="../../base/src/Control.Concurrent.MVar.html#withMVar"><span class="hs-identifier hs-var">withMVar</span></a></span><span> </span><span class="annot"><span class="annottext">MVar ()
</span><a href="#local-6989586621680781983"><span class="hs-identifier hs-var">lock</span></a></span><span> </span><span class="annot"><span class="annottext">((() -&gt; IO FastString) -&gt; IO FastString)
-&gt; (() -&gt; IO FastString) -&gt; IO FastString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; IO FastString
</span><a href="#local-6989586621680781968"><span class="hs-identifier hs-var">insert</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781971"><span class="hs-identifier hs-var">new_fs</span></a></span><span>
</span><span id="line-423"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-424"></span><span>    </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastString.html#FastStringTable"><span class="hs-identifier hs-type">FastStringTable</span></a></span><span> </span><span id="local-6989586621680781967"><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680781967"><span class="hs-identifier hs-var">uid</span></a></span></span><span> </span><span id="local-6989586621680781970"><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680781970"><span class="hs-identifier hs-var">n_zencs</span></a></span></span><span> </span><span id="local-6989586621680781966"><span class="annot"><span class="annottext">Array# (IORef FastStringTableSegment)
</span><a href="#local-6989586621680781966"><span class="hs-identifier hs-var">segments#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastStringTable
</span><a href="GHC.Data.FastString.html#stringTable"><span class="hs-identifier hs-var">stringTable</span></a></span><span>
</span><span id="line-425"></span><span>    </span><span id="local-6989586621680781972"><span class="annot"><span class="annottext">get_uid :: IO Int
</span><a href="#local-6989586621680781972"><span class="hs-identifier hs-var hs-var">get_uid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IORef Int -&gt; (Int -&gt; (Int, Int)) -&gt; IO Int
forall a b. IORef a -&gt; (a -&gt; (a, b)) -&gt; IO b
</span><a href="../../base/src/GHC.IORef.html#atomicModifyIORef%27"><span class="hs-identifier hs-var">atomicModifyIORef'</span></a></span><span> </span><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680781967"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="annot"><span class="annottext">((Int -&gt; (Int, Int)) -&gt; IO Int) -&gt; (Int -&gt; (Int, Int)) -&gt; IO Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680781962"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781962"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781962"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781962"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-426"></span><span>
</span><span id="line-427"></span><span>    </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680781979"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781979"><span class="hs-identifier hs-var">hash#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ShortByteString -&gt; Int
</span><a href="GHC.Data.FastString.html#hashStr"><span class="hs-identifier hs-var">hashStr</span></a></span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781984"><span class="hs-identifier hs-var">sbs</span></a></span><span>
</span><span id="line-428"></span><span>    </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680781981"><span class="annot"><span class="annottext">IORef FastStringTableSegment
</span><a href="#local-6989586621680781981"><span class="hs-identifier hs-var">segmentRef</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array# (IORef FastStringTableSegment)
-&gt; Int# -&gt; (# IORef FastStringTableSegment #)
forall a. Array# a -&gt; Int# -&gt; (# a #)
</span><span class="hs-identifier hs-var">indexArray#</span></span><span> </span><span class="annot"><span class="annottext">Array# (IORef FastStringTableSegment)
</span><a href="#local-6989586621680781966"><span class="hs-identifier hs-var">segments#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int# -&gt; Int#
</span><a href="GHC.Data.FastString.html#hashToSegment%23"><span class="hs-identifier hs-var">hashToSegment#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781979"><span class="hs-identifier hs-var">hash#</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-429"></span><span>    </span><span id="local-6989586621680781968"><span class="annot"><span class="annottext">insert :: FastString -&gt; IO FastString
</span><a href="#local-6989586621680781968"><span class="hs-identifier hs-var hs-var">insert</span></a></span></span><span> </span><span id="local-6989586621680781952"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781952"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-430"></span><span>      </span><span class="annot"><a href="GHC.Data.FastString.html#FastStringTableSegment"><span class="hs-identifier hs-type">FastStringTableSegment</span></a></span><span> </span><span class="annot"><span class="annottext">MVar ()
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680781951"><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680781951"><span class="hs-identifier hs-var">counter</span></a></span></span><span> </span><span id="local-6989586621680781950"><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680781950"><span class="hs-identifier hs-var">buckets#</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef FastStringTableSegment -&gt; IO FastStringTableSegment
</span><a href="GHC.Data.FastString.html#maybeResizeSegment"><span class="hs-identifier hs-var">maybeResizeSegment</span></a></span><span> </span><span class="annot"><span class="annottext">IORef FastStringTableSegment
</span><a href="#local-6989586621680781981"><span class="hs-identifier hs-var">segmentRef</span></a></span><span>
</span><span id="line-431"></span><span>      </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680781949"><span class="annot"><span class="annottext">idx# :: Int#
</span><a href="#local-6989586621680781949"><span class="hs-identifier hs-var hs-var">idx#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString] -&gt; Int# -&gt; Int#
</span><a href="GHC.Data.FastString.html#hashToIndex%23"><span class="hs-identifier hs-var">hashToIndex#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680781950"><span class="hs-identifier hs-var">buckets#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781979"><span class="hs-identifier hs-var">hash#</span></a></span><span>
</span><span id="line-432"></span><span>      </span><span id="local-6989586621680781948"><span class="annot"><span class="annottext">[FastString]
</span><a href="#local-6989586621680781948"><span class="hs-identifier hs-var">bucket</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, [FastString] #))
-&gt; IO [FastString]
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, [FastString] #))
 -&gt; IO [FastString])
-&gt; (State# RealWorld -&gt; (# State# RealWorld, [FastString] #))
-&gt; IO [FastString]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
-&gt; Int# -&gt; State# RealWorld -&gt; (# State# RealWorld, [FastString] #)
forall d a.
MutableArray# d a -&gt; Int# -&gt; State# d -&gt; (# State# d, a #)
</span><span class="hs-identifier hs-var">readArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680781950"><span class="hs-identifier hs-var">buckets#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781949"><span class="hs-identifier hs-var">idx#</span></a></span><span>
</span><span id="line-433"></span><span>      </span><span id="local-6989586621680781947"><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621680781947"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[FastString] -&gt; ShortByteString -&gt; IO (Maybe FastString)
</span><a href="GHC.Data.FastString.html#bucket_match"><span class="hs-identifier hs-var">bucket_match</span></a></span><span> </span><span class="annot"><span class="annottext">[FastString]
</span><a href="#local-6989586621680781948"><span class="hs-identifier hs-var">bucket</span></a></span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781984"><span class="hs-identifier hs-var">sbs</span></a></span><span>
</span><span id="line-434"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="#local-6989586621680781947"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-435"></span><span>        </span><span class="hs-comment">-- The FastString was added by another thread after previous read and</span><span>
</span><span id="line-436"></span><span>        </span><span class="hs-comment">-- before we acquired the write lock.</span><span>
</span><span id="line-437"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680781946"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781946"><span class="hs-identifier hs-var">found</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; IO FastString
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781946"><span class="hs-identifier hs-var">found</span></a></span><span>
</span><span id="line-438"></span><span>        </span><span class="annot"><span class="annottext">Maybe FastString
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-439"></span><span>          </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ()
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ())
-&gt; (State# RealWorld -&gt; (# State# RealWorld, () #)) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680781945"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781945"><span class="hs-identifier hs-var">s1#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-440"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
-&gt; Int# -&gt; [FastString] -&gt; State# RealWorld -&gt; State# RealWorld
forall d a. MutableArray# d a -&gt; Int# -&gt; a -&gt; State# d -&gt; State# d
</span><span class="hs-identifier hs-var">writeArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680781950"><span class="hs-identifier hs-var">buckets#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781949"><span class="hs-identifier hs-var">idx#</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781952"><span class="hs-identifier hs-var">fs</span></a></span><span class="annot"><span class="annottext">FastString -&gt; [FastString] -&gt; [FastString]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[FastString]
</span><a href="#local-6989586621680781948"><span class="hs-identifier hs-var">bucket</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781945"><span class="hs-identifier hs-var">s1#</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-441"></span><span>              </span><span id="local-6989586621680781944"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781944"><span class="hs-identifier hs-var">s2#</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781944"><span class="hs-identifier hs-var">s2#</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-special">#)</span><span>
</span><span id="line-442"></span><span>          </span><span class="annot"><span class="annottext">IORef Int -&gt; (Int -&gt; Int) -&gt; IO ()
forall a. IORef a -&gt; (a -&gt; a) -&gt; IO ()
</span><a href="../../base/src/Data.IORef.html#modifyIORef%27"><span class="hs-identifier hs-var">modifyIORef'</span></a></span><span> </span><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680781951"><span class="hs-identifier hs-var">counter</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int
forall a. Enum a =&gt; a -&gt; a
</span><a href="../../base/src/GHC.Enum.html#succ"><span class="hs-identifier hs-var">succ</span></a></span><span>
</span><span id="line-443"></span><span>          </span><span class="annot"><span class="annottext">FastString -&gt; IO FastString
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781952"><span class="hs-identifier hs-var">fs</span></a></span><span>
</span><span id="line-444"></span><span>
</span><span id="line-445"></span><span class="annot"><a href="GHC.Data.FastString.html#bucket_match"><span class="hs-identifier hs-type">bucket_match</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#ShortByteString"><span class="hs-identifier hs-type">ShortByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-446"></span><span id="bucket_match"><span class="annot"><span class="annottext">bucket_match :: [FastString] -&gt; ShortByteString -&gt; IO (Maybe FastString)
</span><a href="GHC.Data.FastString.html#bucket_match"><span class="hs-identifier hs-var hs-var">bucket_match</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe FastString -&gt; IO (Maybe FastString)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe FastString
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-447"></span><span class="annot"><a href="GHC.Data.FastString.html#bucket_match"><span class="hs-identifier hs-var">bucket_match</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680781941"><span class="annot"><span class="annottext">fs :: FastString
</span><a href="#local-6989586621680781941"><span class="hs-identifier hs-var">fs</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">fs_sbs :: FastString -&gt; ShortByteString
</span><a href="GHC.Data.FastString.html#fs_sbs"><span class="hs-identifier hs-var">fs_sbs</span></a></span><span class="hs-glyph">=</span><span id="local-6989586621680781940"><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781940"><span class="hs-identifier hs-var">fs_sbs</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621680781939"><span class="annot"><span class="annottext">[FastString]
</span><a href="#local-6989586621680781939"><span class="hs-identifier hs-var">ls</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680781938"><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781938"><span class="hs-identifier hs-var">sbs</span></a></span></span><span>
</span><span id="line-448"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781940"><span class="hs-identifier hs-var">fs_sbs</span></a></span><span> </span><span class="annot"><span class="annottext">ShortByteString -&gt; ShortByteString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781938"><span class="hs-identifier hs-var">sbs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe FastString -&gt; IO (Maybe FastString)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; Maybe FastString
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781941"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-449"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>     </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">[FastString] -&gt; ShortByteString -&gt; IO (Maybe FastString)
</span><a href="GHC.Data.FastString.html#bucket_match"><span class="hs-identifier hs-var">bucket_match</span></a></span><span> </span><span class="annot"><span class="annottext">[FastString]
</span><a href="#local-6989586621680781939"><span class="hs-identifier hs-var">ls</span></a></span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781938"><span class="hs-identifier hs-var">sbs</span></a></span><span>
</span><span id="line-450"></span><span>
</span><span id="line-451"></span><span class="annot"><a href="GHC.Data.FastString.html#mkFastStringBytes"><span class="hs-identifier hs-type">mkFastStringBytes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-452"></span><span id="mkFastStringBytes"><span class="annot"><span class="annottext">mkFastStringBytes :: Ptr Word8 -&gt; Int -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastStringBytes"><span class="hs-identifier hs-var hs-var">mkFastStringBytes</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621680781937"><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621680781937"><span class="hs-identifier hs-var">ptr</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621680781936"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781936"><span class="hs-identifier hs-var">len</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-453"></span><span>    </span><span class="hs-comment">-- NB: Might as well use unsafeDupablePerformIO, since mkFastStringWith is</span><span>
</span><span id="line-454"></span><span>    </span><span class="hs-comment">-- idempotent.</span><span>
</span><span id="line-455"></span><span>    </span><span class="annot"><span class="annottext">IO FastString -&gt; FastString
forall a. IO a -&gt; a
</span><a href="../../base/src/GHC.IO.Unsafe.html#unsafeDupablePerformIO"><span class="hs-identifier hs-var">unsafeDupablePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO FastString -&gt; FastString) -&gt; IO FastString -&gt; FastString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-456"></span><span>        </span><span id="local-6989586621680781934"><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781934"><span class="hs-identifier hs-var">sbs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; IO ShortByteString
forall a. Ptr a -&gt; Int -&gt; IO ShortByteString
</span><a href="GHC.Data.FastString.html#newSBSFromPtr"><span class="hs-identifier hs-var">newSBSFromPtr</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621680781937"><span class="hs-identifier hs-var">ptr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781936"><span class="hs-identifier hs-var">len</span></a></span><span>
</span><span id="line-457"></span><span>        </span><span class="annot"><span class="annottext">(Int -&gt; IORef Int -&gt; IO FastString)
-&gt; ShortByteString -&gt; IO FastString
</span><a href="GHC.Data.FastString.html#mkFastStringWith"><span class="hs-identifier hs-var">mkFastStringWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ShortByteString -&gt; Int -&gt; IORef Int -&gt; IO FastString
</span><a href="GHC.Data.FastString.html#mkNewFastStringShortByteString"><span class="hs-identifier hs-var">mkNewFastStringShortByteString</span></a></span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781934"><span class="hs-identifier hs-var">sbs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781934"><span class="hs-identifier hs-var">sbs</span></a></span><span>
</span><span id="line-458"></span><span>
</span><span id="line-459"></span><span id="local-6989586621680782389"><span class="annot"><a href="GHC.Data.FastString.html#newSBSFromPtr"><span class="hs-identifier hs-type">newSBSFromPtr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680782389"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#ShortByteString"><span class="hs-identifier hs-type">ShortByteString</span></a></span></span><span>
</span><span id="line-460"></span><span id="newSBSFromPtr"><span class="annot"><span class="annottext">newSBSFromPtr :: forall a. Ptr a -&gt; Int -&gt; IO ShortByteString
</span><a href="GHC.Data.FastString.html#newSBSFromPtr"><span class="hs-identifier hs-var hs-var">newSBSFromPtr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span id="local-6989586621680781931"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680781931"><span class="hs-identifier hs-var">src#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680781930"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781930"><span class="hs-identifier hs-var">len#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-461"></span><span>  </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, ShortByteString #))
-&gt; IO ShortByteString
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, ShortByteString #))
 -&gt; IO ShortByteString)
-&gt; (State# RealWorld -&gt; (# State# RealWorld, ShortByteString #))
-&gt; IO ShortByteString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680781929"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781929"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-462"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int#
-&gt; State# RealWorld
-&gt; (# State# RealWorld, MutableByteArray# RealWorld #)
forall d. Int# -&gt; State# d -&gt; (# State# d, MutableByteArray# d #)
</span><span class="hs-identifier hs-var">newByteArray#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781930"><span class="hs-identifier hs-var">len#</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781929"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680781928"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781928"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680781927"><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680781927"><span class="hs-identifier hs-var">dst#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-463"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Addr#
-&gt; MutableByteArray# RealWorld
-&gt; Int#
-&gt; Int#
-&gt; State# RealWorld
-&gt; State# RealWorld
forall d.
Addr#
-&gt; MutableByteArray# d -&gt; Int# -&gt; Int# -&gt; State# d -&gt; State# d
</span><span class="hs-identifier hs-var">copyAddrToByteArray#</span></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680781931"><span class="hs-identifier hs-var">src#</span></a></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680781927"><span class="hs-identifier hs-var">dst#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781930"><span class="hs-identifier hs-var">len#</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781928"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621680781926"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781926"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-464"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
-&gt; State# RealWorld -&gt; (# State# RealWorld, ByteArray# #)
forall d.
MutableByteArray# d -&gt; State# d -&gt; (# State# d, ByteArray# #)
</span><span class="hs-identifier hs-var">unsafeFreezeByteArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableByteArray# RealWorld
</span><a href="#local-6989586621680781927"><span class="hs-identifier hs-var">dst#</span></a></span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781926"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680781925"><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781925"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680781924"><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621680781924"><span class="hs-identifier hs-var">ba#</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-465"></span><span>    </span><span class="hs-special">(#</span><span> </span><span class="annot"><span class="annottext">State# RealWorld
</span><a href="#local-6989586621680781925"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteArray# -&gt; ShortByteString
</span><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#SBS"><span class="hs-identifier hs-var">SBS.SBS</span></a></span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621680781924"><span class="hs-identifier hs-var">ba#</span></a></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-466"></span><span>
</span><span id="line-467"></span><span class="hs-comment">-- | Create a 'FastString' by copying an existing 'ByteString'</span><span>
</span><span id="line-468"></span><span class="annot"><a href="GHC.Data.FastString.html#mkFastStringByteString"><span class="hs-identifier hs-type">mkFastStringByteString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-469"></span><span id="mkFastStringByteString"><span class="annot"><span class="annottext">mkFastStringByteString :: ByteString -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastStringByteString"><span class="hs-identifier hs-var hs-var">mkFastStringByteString</span></a></span></span><span> </span><span id="local-6989586621680781922"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680781922"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-470"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680781921"><span class="annot"><span class="annottext">sbs :: ShortByteString
</span><a href="#local-6989586621680781921"><span class="hs-identifier hs-var hs-var">sbs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ShortByteString
</span><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#toShort"><span class="hs-identifier hs-var">SBS.toShort</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621680781922"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="hs-keyword">in</span><span>
</span><span id="line-471"></span><span>  </span><span class="annot"><span class="annottext">IO FastString -&gt; FastString
forall a. IO a -&gt; a
</span><a href="GHC.Utils.IO.Unsafe.html#inlinePerformIO"><span class="hs-identifier hs-var">inlinePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO FastString -&gt; FastString) -&gt; IO FastString -&gt; FastString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-472"></span><span>      </span><span class="annot"><span class="annottext">(Int -&gt; IORef Int -&gt; IO FastString)
-&gt; ShortByteString -&gt; IO FastString
</span><a href="GHC.Data.FastString.html#mkFastStringWith"><span class="hs-identifier hs-var">mkFastStringWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ShortByteString -&gt; Int -&gt; IORef Int -&gt; IO FastString
</span><a href="GHC.Data.FastString.html#mkNewFastStringShortByteString"><span class="hs-identifier hs-var">mkNewFastStringShortByteString</span></a></span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781921"><span class="hs-identifier hs-var">sbs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781921"><span class="hs-identifier hs-var">sbs</span></a></span><span>
</span><span id="line-473"></span><span>
</span><span id="line-474"></span><span class="hs-comment">-- | Create a 'FastString' from an existing 'ShortByteString' without</span><span>
</span><span id="line-475"></span><span class="hs-comment">-- copying.</span><span>
</span><span id="line-476"></span><span class="annot"><a href="GHC.Data.FastString.html#mkFastStringShortByteString"><span class="hs-identifier hs-type">mkFastStringShortByteString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#ShortByteString"><span class="hs-identifier hs-type">ShortByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-477"></span><span id="mkFastStringShortByteString"><span class="annot"><span class="annottext">mkFastStringShortByteString :: ShortByteString -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastStringShortByteString"><span class="hs-identifier hs-var hs-var">mkFastStringShortByteString</span></a></span></span><span> </span><span id="local-6989586621680781919"><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781919"><span class="hs-identifier hs-var">sbs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-478"></span><span>  </span><span class="annot"><span class="annottext">IO FastString -&gt; FastString
forall a. IO a -&gt; a
</span><a href="GHC.Utils.IO.Unsafe.html#inlinePerformIO"><span class="hs-identifier hs-var">inlinePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO FastString -&gt; FastString) -&gt; IO FastString -&gt; FastString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Int -&gt; IORef Int -&gt; IO FastString)
-&gt; ShortByteString -&gt; IO FastString
</span><a href="GHC.Data.FastString.html#mkFastStringWith"><span class="hs-identifier hs-var">mkFastStringWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ShortByteString -&gt; Int -&gt; IORef Int -&gt; IO FastString
</span><a href="GHC.Data.FastString.html#mkNewFastStringShortByteString"><span class="hs-identifier hs-var">mkNewFastStringShortByteString</span></a></span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781919"><span class="hs-identifier hs-var">sbs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781919"><span class="hs-identifier hs-var">sbs</span></a></span><span>
</span><span id="line-479"></span><span>
</span><span id="line-480"></span><span class="hs-comment">-- | Creates a UTF-8 encoded 'FastString' from a 'String'</span><span>
</span><span id="line-481"></span><span class="annot"><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-type">mkFastString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-482"></span><span id="mkFastString"><span class="annot"><span class="annottext">mkFastString :: String -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var hs-var">mkFastString</span></a></span></span><span> </span><span id="local-6989586621680781918"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680781918"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-483"></span><span>  </span><span class="annot"><span class="annottext">IO FastString -&gt; FastString
forall a. IO a -&gt; a
</span><a href="GHC.Utils.IO.Unsafe.html#inlinePerformIO"><span class="hs-identifier hs-var">inlinePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO FastString -&gt; FastString) -&gt; IO FastString -&gt; FastString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-484"></span><span>    </span><span id="local-6989586621680781917"><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781917"><span class="hs-identifier hs-var">sbs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO ShortByteString
</span><a href="GHC.Utils.Encoding.html#utf8EncodeShortByteString"><span class="hs-identifier hs-var">utf8EncodeShortByteString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680781918"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-485"></span><span>    </span><span class="annot"><span class="annottext">(Int -&gt; IORef Int -&gt; IO FastString)
-&gt; ShortByteString -&gt; IO FastString
</span><a href="GHC.Data.FastString.html#mkFastStringWith"><span class="hs-identifier hs-var">mkFastStringWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ShortByteString -&gt; Int -&gt; IORef Int -&gt; IO FastString
</span><a href="GHC.Data.FastString.html#mkNewFastStringShortByteString"><span class="hs-identifier hs-var">mkNewFastStringShortByteString</span></a></span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781917"><span class="hs-identifier hs-var">sbs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781917"><span class="hs-identifier hs-var">sbs</span></a></span><span>
</span><span id="line-486"></span><span>
</span><span id="line-487"></span><span class="hs-comment">-- | Creates a 'FastString' from a UTF-8 encoded @[Word8]@</span><span>
</span><span id="line-488"></span><span class="annot"><a href="GHC.Data.FastString.html#mkFastStringByteList"><span class="hs-identifier hs-type">mkFastStringByteList</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-489"></span><span id="mkFastStringByteList"><span class="annot"><span class="annottext">mkFastStringByteList :: [Word8] -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastStringByteList"><span class="hs-identifier hs-var hs-var">mkFastStringByteList</span></a></span></span><span> </span><span id="local-6989586621680781915"><span class="annot"><span class="annottext">[Word8]
</span><a href="#local-6989586621680781915"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ShortByteString -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastStringShortByteString"><span class="hs-identifier hs-var">mkFastStringShortByteString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Word8] -&gt; ShortByteString
</span><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#pack"><span class="hs-identifier hs-var">SBS.pack</span></a></span><span> </span><span class="annot"><span class="annottext">[Word8]
</span><a href="#local-6989586621680781915"><span class="hs-identifier hs-var">str</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-490"></span><span>
</span><span id="line-491"></span><span class="hs-comment">-- | Creates a (lazy) Z-encoded 'FastString' from a 'ShortByteString' and</span><span>
</span><span id="line-492"></span><span class="hs-comment">-- account the number of forced z-strings into the passed 'IORef'.</span><span>
</span><span id="line-493"></span><span class="annot"><a href="GHC.Data.FastString.html#mkZFastString"><span class="hs-identifier hs-type">mkZFastString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IORef.html#IORef"><span class="hs-identifier hs-type">IORef</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#ShortByteString"><span class="hs-identifier hs-type">ShortByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastZString"><span class="hs-identifier hs-type">FastZString</span></a></span><span>
</span><span id="line-494"></span><span id="mkZFastString"><span class="annot"><span class="annottext">mkZFastString :: IORef Int -&gt; ShortByteString -&gt; FastZString
</span><a href="GHC.Data.FastString.html#mkZFastString"><span class="hs-identifier hs-var hs-var">mkZFastString</span></a></span></span><span> </span><span id="local-6989586621680781912"><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680781912"><span class="hs-identifier hs-var">n_zencs</span></a></span></span><span> </span><span id="local-6989586621680781911"><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781911"><span class="hs-identifier hs-var">sbs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO FastZString -&gt; FastZString
forall a. IO a -&gt; a
</span><a href="../../base/src/GHC.IO.Unsafe.html#unsafePerformIO"><span class="hs-identifier hs-var">unsafePerformIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO FastZString -&gt; FastZString) -&gt; IO FastZString -&gt; FastZString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-495"></span><span>  </span><span class="annot"><span class="annottext">IORef Int -&gt; (Int -&gt; (Int, ())) -&gt; IO ()
forall a b. IORef a -&gt; (a -&gt; (a, b)) -&gt; IO b
</span><a href="../../base/src/GHC.IORef.html#atomicModifyIORef%27"><span class="hs-identifier hs-var">atomicModifyIORef'</span></a></span><span> </span><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680781912"><span class="hs-identifier hs-var">n_zencs</span></a></span><span> </span><span class="annot"><span class="annottext">((Int -&gt; (Int, ())) -&gt; IO ()) -&gt; (Int -&gt; (Int, ())) -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621680781910"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781910"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781910"><span class="hs-identifier hs-var">n</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-496"></span><span>  </span><span class="annot"><span class="annottext">FastZString -&gt; IO FastZString
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(FastZString -&gt; IO FastZString) -&gt; FastZString -&gt; IO FastZString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; FastZString
</span><a href="GHC.Data.FastString.html#mkFastZStringString"><span class="hs-identifier hs-var">mkFastZStringString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ShowS
</span><a href="GHC.Utils.Encoding.html#zEncodeString"><span class="hs-identifier hs-var">zEncodeString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ShortByteString -&gt; String
</span><a href="GHC.Utils.Encoding.html#utf8DecodeShortByteString"><span class="hs-identifier hs-var">utf8DecodeShortByteString</span></a></span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781911"><span class="hs-identifier hs-var">sbs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-497"></span><span>
</span><span id="line-498"></span><span class="annot"><a href="GHC.Data.FastString.html#mkNewFastStringShortByteString"><span class="hs-identifier hs-type">mkNewFastStringShortByteString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#ShortByteString"><span class="hs-identifier hs-type">ShortByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-499"></span><span>                               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.IORef.html#IORef"><span class="hs-identifier hs-type">IORef</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-500"></span><span id="mkNewFastStringShortByteString"><span class="annot"><span class="annottext">mkNewFastStringShortByteString :: ShortByteString -&gt; Int -&gt; IORef Int -&gt; IO FastString
</span><a href="GHC.Data.FastString.html#mkNewFastStringShortByteString"><span class="hs-identifier hs-var hs-var">mkNewFastStringShortByteString</span></a></span></span><span> </span><span id="local-6989586621680781907"><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781907"><span class="hs-identifier hs-var">sbs</span></a></span></span><span> </span><span id="local-6989586621680781906"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781906"><span class="hs-identifier hs-var">uid</span></a></span></span><span> </span><span id="local-6989586621680781905"><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680781905"><span class="hs-identifier hs-var">n_zencs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-501"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680781904"><span class="annot"><span class="annottext">zstr :: FastZString
</span><a href="#local-6989586621680781904"><span class="hs-identifier hs-var hs-var">zstr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IORef Int -&gt; ShortByteString -&gt; FastZString
</span><a href="GHC.Data.FastString.html#mkZFastString"><span class="hs-identifier hs-var">mkZFastString</span></a></span><span> </span><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680781905"><span class="hs-identifier hs-var">n_zencs</span></a></span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781907"><span class="hs-identifier hs-var">sbs</span></a></span><span>
</span><span id="line-502"></span><span>  </span><span id="local-6989586621680781903"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781903"><span class="hs-identifier hs-var">chars</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ShortByteString -&gt; IO Int
</span><a href="GHC.Utils.Encoding.html#countUTF8Chars"><span class="hs-identifier hs-var">countUTF8Chars</span></a></span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781907"><span class="hs-identifier hs-var">sbs</span></a></span><span>
</span><span id="line-503"></span><span>  </span><span class="annot"><span class="annottext">FastString -&gt; IO FastString
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ShortByteString -&gt; FastZString -&gt; FastString
</span><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-var">FastString</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781906"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781903"><span class="hs-identifier hs-var">chars</span></a></span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781907"><span class="hs-identifier hs-var">sbs</span></a></span><span> </span><span class="annot"><span class="annottext">FastZString
</span><a href="#local-6989586621680781904"><span class="hs-identifier hs-var">zstr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-504"></span><span>
</span><span id="line-505"></span><span class="annot"><a href="GHC.Data.FastString.html#hashStr"><span class="hs-identifier hs-type">hashStr</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#ShortByteString"><span class="hs-identifier hs-type">ShortByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-506"></span><span> </span><span class="hs-comment">-- produce a hash value between 0 &amp; m (inclusive)</span><span>
</span><span id="line-507"></span><span id="hashStr"><span class="annot"><span class="annottext">hashStr :: ShortByteString -&gt; Int
</span><a href="GHC.Data.FastString.html#hashStr"><span class="hs-identifier hs-var hs-var">hashStr</span></a></span></span><span> </span><span id="local-6989586621680781901"><span class="annot"><span class="annottext">sbs :: ShortByteString
</span><a href="#local-6989586621680781901"><span class="hs-identifier hs-var">sbs</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#SBS"><span class="hs-identifier hs-type">SBS.SBS</span></a></span><span> </span><span id="local-6989586621680781900"><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621680781900"><span class="hs-identifier hs-var">ba#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int
</span><a href="#local-6989586621680781899"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">0#</span></span><span>
</span><span id="line-508"></span><span>   </span><span class="hs-keyword">where</span><span>
</span><span id="line-509"></span><span>    </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680781898"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781898"><span class="hs-identifier hs-var">len#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ShortByteString -&gt; Int
</span><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#length"><span class="hs-identifier hs-var">SBS.length</span></a></span><span> </span><span class="annot"><span class="annottext">ShortByteString
</span><a href="#local-6989586621680781901"><span class="hs-identifier hs-var">sbs</span></a></span><span>
</span><span id="line-510"></span><span>    </span><span id="local-6989586621680781899"><span class="annot"><span class="annottext">loop :: Int# -&gt; Int# -&gt; Int
</span><a href="#local-6989586621680781899"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span id="local-6989586621680781896"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781896"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span id="local-6989586621680781895"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781895"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-511"></span><span>      </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Bool
</span><span class="hs-identifier hs-var">isTrue#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781895"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">==#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781898"><span class="hs-identifier hs-var">len#</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">then</span><span>
</span><span id="line-512"></span><span>        </span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><span class="hs-identifier hs-var">I#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781896"><span class="hs-identifier hs-var">h</span></a></span><span>
</span><span id="line-513"></span><span>      </span><span class="hs-keyword">else</span><span>
</span><span id="line-514"></span><span>        </span><span class="hs-keyword">let</span><span>
</span><span id="line-515"></span><span>          </span><span class="hs-comment">-- DO NOT move this let binding! indexCharOffAddr# reads from the</span><span>
</span><span id="line-516"></span><span>          </span><span class="hs-comment">-- pointer so we need to evaluate this based on the length check</span><span>
</span><span id="line-517"></span><span>          </span><span class="hs-comment">-- above. Not doing this right caused #17909.</span><span>
</span><span id="line-518"></span><span>          </span><span class="hs-glyph">!</span><span id="local-6989586621680781894"><span class="annot"><span class="annottext">c :: Int#
</span><a href="#local-6989586621680781894"><span class="hs-identifier hs-var hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteArray# -&gt; Int# -&gt; Int#
</span><span class="hs-identifier hs-var">indexInt8Array#</span></span><span> </span><span class="annot"><span class="annottext">ByteArray#
</span><a href="#local-6989586621680781900"><span class="hs-identifier hs-var">ba#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781895"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-519"></span><span>          </span><span class="hs-glyph">!</span><span id="local-6989586621680781893"><span class="annot"><span class="annottext">h2 :: Int#
</span><a href="#local-6989586621680781893"><span class="hs-identifier hs-var hs-var">h2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781896"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">*#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">16777619#</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">`xorI#`</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781894"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-520"></span><span>        </span><span class="hs-keyword">in</span><span>
</span><span id="line-521"></span><span>          </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int
</span><a href="#local-6989586621680781899"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781893"><span class="hs-identifier hs-var">h2</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781895"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int# -&gt; Int#
</span><span class="hs-operator hs-var">+#</span></span><span> </span><span class="annot"><span class="annottext">Int#
</span><span class="hs-number">1#</span></span><span class="hs-special">)</span><span>
</span><span id="line-522"></span><span>
</span><span id="line-523"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-524"></span><span class="hs-comment">-- Operations</span><span>
</span><span id="line-525"></span><span>
</span><span id="line-526"></span><span class="hs-comment">-- | Returns the length of the 'FastString' in characters</span><span>
</span><span id="line-527"></span><span class="annot"><a href="GHC.Data.FastString.html#lengthFS"><span class="hs-identifier hs-type">lengthFS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-528"></span><span id="lengthFS"><span class="annot"><span class="annottext">lengthFS :: FastString -&gt; Int
</span><a href="GHC.Data.FastString.html#lengthFS"><span class="hs-identifier hs-var hs-var">lengthFS</span></a></span></span><span> </span><span id="local-6989586621680781892"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781892"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Int
</span><a href="GHC.Data.FastString.html#n_chars"><span class="hs-identifier hs-var hs-var">n_chars</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781892"><span class="hs-identifier hs-var">fs</span></a></span><span>
</span><span id="line-529"></span><span>
</span><span id="line-530"></span><span class="hs-comment">-- | Returns @True@ if the 'FastString' is empty</span><span>
</span><span id="line-531"></span><span class="annot"><a href="GHC.Data.FastString.html#nullFS"><span class="hs-identifier hs-type">nullFS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-532"></span><span id="nullFS"><span class="annot"><span class="annottext">nullFS :: FastString -&gt; Bool
</span><a href="GHC.Data.FastString.html#nullFS"><span class="hs-identifier hs-var hs-var">nullFS</span></a></span></span><span> </span><span id="local-6989586621680781891"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781891"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ShortByteString -&gt; Bool
</span><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#null"><span class="hs-identifier hs-var">SBS.null</span></a></span><span> </span><span class="annot"><span class="annottext">(ShortByteString -&gt; Bool) -&gt; ShortByteString -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; ShortByteString
</span><a href="GHC.Data.FastString.html#fs_sbs"><span class="hs-identifier hs-var hs-var">fs_sbs</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781891"><span class="hs-identifier hs-var">fs</span></a></span><span>
</span><span id="line-533"></span><span>
</span><span id="line-534"></span><span class="hs-comment">-- | Unpacks and decodes the FastString</span><span>
</span><span id="line-535"></span><span class="annot"><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier hs-type">unpackFS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-536"></span><span id="unpackFS"><span class="annot"><span class="annottext">unpackFS :: FastString -&gt; String
</span><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier hs-var hs-var">unpackFS</span></a></span></span><span> </span><span id="local-6989586621680781889"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781889"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ShortByteString -&gt; String
</span><a href="GHC.Utils.Encoding.html#utf8DecodeShortByteString"><span class="hs-identifier hs-var">utf8DecodeShortByteString</span></a></span><span> </span><span class="annot"><span class="annottext">(ShortByteString -&gt; String) -&gt; ShortByteString -&gt; String
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; ShortByteString
</span><a href="GHC.Data.FastString.html#fs_sbs"><span class="hs-identifier hs-var hs-var">fs_sbs</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781889"><span class="hs-identifier hs-var">fs</span></a></span><span>
</span><span id="line-537"></span><span>
</span><span id="line-538"></span><span class="hs-comment">-- | Returns a Z-encoded version of a 'FastString'.  This might be the</span><span>
</span><span id="line-539"></span><span class="hs-comment">-- original, if it was already Z-encoded.  The first time this</span><span>
</span><span id="line-540"></span><span class="hs-comment">-- function is applied to a particular 'FastString', the results are</span><span>
</span><span id="line-541"></span><span class="hs-comment">-- memoized.</span><span>
</span><span id="line-542"></span><span class="hs-comment">--</span><span>
</span><span id="line-543"></span><span class="annot"><a href="GHC.Data.FastString.html#zEncodeFS"><span class="hs-identifier hs-type">zEncodeFS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastZString"><span class="hs-identifier hs-type">FastZString</span></a></span><span>
</span><span id="line-544"></span><span id="zEncodeFS"><span class="annot"><span class="annottext">zEncodeFS :: FastString -&gt; FastZString
</span><a href="GHC.Data.FastString.html#zEncodeFS"><span class="hs-identifier hs-var hs-var">zEncodeFS</span></a></span></span><span> </span><span id="local-6989586621680781888"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781888"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastZString
</span><a href="GHC.Data.FastString.html#fs_zenc"><span class="hs-identifier hs-var hs-var">fs_zenc</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781888"><span class="hs-identifier hs-var">fs</span></a></span><span>
</span><span id="line-545"></span><span>
</span><span id="line-546"></span><span class="annot"><a href="GHC.Data.FastString.html#appendFS"><span class="hs-identifier hs-type">appendFS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-547"></span><span id="appendFS"><span class="annot"><span class="annottext">appendFS :: FastString -&gt; FastString -&gt; FastString
</span><a href="GHC.Data.FastString.html#appendFS"><span class="hs-identifier hs-var hs-var">appendFS</span></a></span></span><span> </span><span id="local-6989586621680781887"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781887"><span class="hs-identifier hs-var">fs1</span></a></span></span><span> </span><span id="local-6989586621680781886"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781886"><span class="hs-identifier hs-var">fs2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastStringByteString"><span class="hs-identifier hs-var">mkFastStringByteString</span></a></span><span>
</span><span id="line-548"></span><span>                 </span><span class="annot"><span class="annottext">(ByteString -&gt; FastString) -&gt; ByteString -&gt; FastString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ByteString -&gt; ByteString
</span><a href="../../bytestring/src/Data.ByteString.html#append"><span class="hs-identifier hs-var">BS.append</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; ByteString
</span><a href="GHC.Data.FastString.html#bytesFS"><span class="hs-identifier hs-var">bytesFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781887"><span class="hs-identifier hs-var">fs1</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; ByteString
</span><a href="GHC.Data.FastString.html#bytesFS"><span class="hs-identifier hs-var">bytesFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781886"><span class="hs-identifier hs-var">fs2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-549"></span><span>
</span><span id="line-550"></span><span class="annot"><a href="GHC.Data.FastString.html#concatFS"><span class="hs-identifier hs-type">concatFS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-551"></span><span id="concatFS"><span class="annot"><span class="annottext">concatFS :: [FastString] -&gt; FastString
</span><a href="GHC.Data.FastString.html#concatFS"><span class="hs-identifier hs-var hs-var">concatFS</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ShortByteString -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastStringShortByteString"><span class="hs-identifier hs-var">mkFastStringShortByteString</span></a></span><span> </span><span class="annot"><span class="annottext">(ShortByteString -&gt; FastString)
-&gt; ([FastString] -&gt; ShortByteString) -&gt; [FastString] -&gt; FastString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[ShortByteString] -&gt; ShortByteString
forall a. Monoid a =&gt; [a] -&gt; a
</span><a href="../../base/src/GHC.Base.html#mconcat"><span class="hs-identifier hs-var">mconcat</span></a></span><span> </span><span class="annot"><span class="annottext">([ShortByteString] -&gt; ShortByteString)
-&gt; ([FastString] -&gt; [ShortByteString])
-&gt; [FastString]
-&gt; ShortByteString
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(FastString -&gt; ShortByteString)
-&gt; [FastString] -&gt; [ShortByteString]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; ShortByteString
</span><a href="GHC.Data.FastString.html#fs_sbs"><span class="hs-identifier hs-var hs-var">fs_sbs</span></a></span><span>
</span><span id="line-552"></span><span>
</span><span id="line-553"></span><span class="annot"><a href="GHC.Data.FastString.html#headFS"><span class="hs-identifier hs-type">headFS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span>
</span><span id="line-554"></span><span id="headFS"><span class="annot"><span class="annottext">headFS :: FastString -&gt; Char
</span><a href="GHC.Data.FastString.html#headFS"><span class="hs-identifier hs-var hs-var">headFS</span></a></span></span><span> </span><span id="local-6989586621680781883"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781883"><span class="hs-identifier hs-var">fs</span></a></span></span><span>
</span><span id="line-555"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ShortByteString -&gt; Bool
</span><a href="../../bytestring/src/Data.ByteString.Short.Internal.html#null"><span class="hs-identifier hs-var">SBS.null</span></a></span><span> </span><span class="annot"><span class="annottext">(ShortByteString -&gt; Bool) -&gt; ShortByteString -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; ShortByteString
</span><a href="GHC.Data.FastString.html#fs_sbs"><span class="hs-identifier hs-var hs-var">fs_sbs</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781883"><span class="hs-identifier hs-var">fs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Char
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;headFS: Empty FastString&quot;</span></span><span>
</span><span id="line-556"></span><span class="annot"><a href="GHC.Data.FastString.html#headFS"><span class="hs-identifier hs-var">headFS</span></a></span><span> </span><span id="local-6989586621680781882"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781882"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Char
forall a. [a] -&gt; a
</span><a href="../../base/src/GHC.List.html#head"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; Char) -&gt; String -&gt; Char
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; String
</span><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier hs-var">unpackFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781882"><span class="hs-identifier hs-var">fs</span></a></span><span>
</span><span id="line-557"></span><span>
</span><span id="line-558"></span><span class="annot"><a href="GHC.Data.FastString.html#consFS"><span class="hs-identifier hs-type">consFS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-559"></span><span id="consFS"><span class="annot"><span class="annottext">consFS :: Char -&gt; FastString -&gt; FastString
</span><a href="GHC.Data.FastString.html#consFS"><span class="hs-identifier hs-var hs-var">consFS</span></a></span></span><span> </span><span id="local-6989586621680781880"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680781880"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621680781879"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781879"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680781880"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; ShowS
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; String
</span><a href="GHC.Data.FastString.html#unpackFS"><span class="hs-identifier hs-var">unpackFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781879"><span class="hs-identifier hs-var">fs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-560"></span><span>
</span><span id="line-561"></span><span class="annot"><a href="GHC.Data.FastString.html#uniqueOfFS"><span class="hs-identifier hs-type">uniqueOfFS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-562"></span><span id="uniqueOfFS"><span class="annot"><span class="annottext">uniqueOfFS :: FastString -&gt; Int
</span><a href="GHC.Data.FastString.html#uniqueOfFS"><span class="hs-identifier hs-var hs-var">uniqueOfFS</span></a></span></span><span> </span><span id="local-6989586621680781878"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781878"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString -&gt; Int
</span><a href="GHC.Data.FastString.html#uniq"><span class="hs-identifier hs-var hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781878"><span class="hs-identifier hs-var">fs</span></a></span><span>
</span><span id="line-563"></span><span>
</span><span id="line-564"></span><span class="annot"><a href="GHC.Data.FastString.html#nilFS"><span class="hs-identifier hs-type">nilFS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-565"></span><span id="nilFS"><span class="annot"><span class="annottext">nilFS :: FastString
</span><a href="GHC.Data.FastString.html#nilFS"><span class="hs-identifier hs-var hs-var">nilFS</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-566"></span><span>
</span><span id="line-567"></span><span class="annot"><a href="GHC.Data.FastString.html#isUnderscoreFS"><span class="hs-identifier hs-type">isUnderscoreFS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-568"></span><span id="isUnderscoreFS"><span class="annot"><span class="annottext">isUnderscoreFS :: FastString -&gt; Bool
</span><a href="GHC.Data.FastString.html#isUnderscoreFS"><span class="hs-identifier hs-var hs-var">isUnderscoreFS</span></a></span></span><span> </span><span id="local-6989586621680781877"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781877"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781877"><span class="hs-identifier hs-var">fs</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; FastString -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;_&quot;</span></span><span>
</span><span id="line-569"></span><span>
</span><span id="line-570"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-571"></span><span class="hs-comment">-- Stats</span><span>
</span><span id="line-572"></span><span>
</span><span id="line-573"></span><span class="annot"><a href="GHC.Data.FastString.html#getFastStringTable"><span class="hs-identifier hs-type">getFastStringTable</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">[</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span class="hs-special">]</span><span class="hs-special">]</span><span class="hs-special">]</span><span>
</span><span id="line-574"></span><span id="getFastStringTable"><span class="annot"><span class="annottext">getFastStringTable :: IO [[[FastString]]]
</span><a href="GHC.Data.FastString.html#getFastStringTable"><span class="hs-identifier hs-var hs-var">getFastStringTable</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-575"></span><span>  </span><span class="annot"><span class="annottext">[Int] -&gt; (Int -&gt; IO [[FastString]]) -&gt; IO [[[FastString]]]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#forM"><span class="hs-identifier hs-var">forM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">..</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="GHC.Data.FastString.html#numSegments"><span class="hs-identifier hs-var">numSegments</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">((Int -&gt; IO [[FastString]]) -&gt; IO [[[FastString]]])
-&gt; (Int -&gt; IO [[FastString]]) -&gt; IO [[[FastString]]]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680781875"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781875"><span class="hs-identifier hs-var">i#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-576"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(#</span><span> </span><span id="local-6989586621680781874"><span class="annot"><span class="annottext">IORef FastStringTableSegment
</span><a href="#local-6989586621680781874"><span class="hs-identifier hs-var">segmentRef</span></a></span></span><span> </span><span class="hs-special">#)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Array# (IORef FastStringTableSegment)
-&gt; Int# -&gt; (# IORef FastStringTableSegment #)
forall a. Array# a -&gt; Int# -&gt; (# a #)
</span><span class="hs-identifier hs-var">indexArray#</span></span><span> </span><span class="annot"><span class="annottext">Array# (IORef FastStringTableSegment)
</span><a href="#local-6989586621680781873"><span class="hs-identifier hs-var">segments#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781875"><span class="hs-identifier hs-var">i#</span></a></span><span>
</span><span id="line-577"></span><span>    </span><span class="annot"><a href="GHC.Data.FastString.html#FastStringTableSegment"><span class="hs-identifier hs-type">FastStringTableSegment</span></a></span><span> </span><span class="annot"><span class="annottext">MVar ()
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">IORef Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680781872"><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680781872"><span class="hs-identifier hs-var">buckets#</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef FastStringTableSegment -&gt; IO FastStringTableSegment
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="annot"><span class="annottext">IORef FastStringTableSegment
</span><a href="#local-6989586621680781874"><span class="hs-identifier hs-var">segmentRef</span></a></span><span>
</span><span id="line-578"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680781871"><span class="annot"><span class="annottext">bucketSize :: Int
</span><a href="#local-6989586621680781871"><span class="hs-identifier hs-var hs-var">bucketSize</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int# -&gt; Int
</span><span class="hs-identifier hs-var">I#</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString] -&gt; Int#
forall d a. MutableArray# d a -&gt; Int#
</span><span class="hs-identifier hs-var">sizeofMutableArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680781872"><span class="hs-identifier hs-var">buckets#</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-579"></span><span>    </span><span class="annot"><span class="annottext">[Int] -&gt; (Int -&gt; IO [FastString]) -&gt; IO [[FastString]]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#forM"><span class="hs-identifier hs-var">forM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">..</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781871"><span class="hs-identifier hs-var">bucketSize</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">((Int -&gt; IO [FastString]) -&gt; IO [[FastString]])
-&gt; (Int -&gt; IO [FastString]) -&gt; IO [[FastString]]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680781870"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781870"><span class="hs-identifier hs-var">j#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-580"></span><span>      </span><span class="annot"><span class="annottext">(State# RealWorld -&gt; (# State# RealWorld, [FastString] #))
-&gt; IO [FastString]
forall a. (State# RealWorld -&gt; (# State# RealWorld, a #)) -&gt; IO a
</span><span class="hs-identifier hs-var">IO</span></span><span> </span><span class="annot"><span class="annottext">((State# RealWorld -&gt; (# State# RealWorld, [FastString] #))
 -&gt; IO [FastString])
-&gt; (State# RealWorld -&gt; (# State# RealWorld, [FastString] #))
-&gt; IO [FastString]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
-&gt; Int# -&gt; State# RealWorld -&gt; (# State# RealWorld, [FastString] #)
forall d a.
MutableArray# d a -&gt; Int# -&gt; State# d -&gt; (# State# d, a #)
</span><span class="hs-identifier hs-var">readArray#</span></span><span> </span><span class="annot"><span class="annottext">MutableArray# RealWorld [FastString]
</span><a href="#local-6989586621680781872"><span class="hs-identifier hs-var">buckets#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781870"><span class="hs-identifier hs-var">j#</span></a></span><span>
</span><span id="line-581"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-582"></span><span>    </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastString.html#FastStringTable"><span class="hs-identifier hs-type">FastStringTable</span></a></span><span> </span><span class="annot"><span class="annottext">IORef Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">IORef Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680781873"><span class="annot"><span class="annottext">Array# (IORef FastStringTableSegment)
</span><a href="#local-6989586621680781873"><span class="hs-identifier hs-var">segments#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastStringTable
</span><a href="GHC.Data.FastString.html#stringTable"><span class="hs-identifier hs-var">stringTable</span></a></span><span>
</span><span id="line-583"></span><span>
</span><span id="line-584"></span><span class="annot"><a href="GHC.Data.FastString.html#getFastStringZEncCounter"><span class="hs-identifier hs-type">getFastStringZEncCounter</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-585"></span><span id="getFastStringZEncCounter"><span class="annot"><span class="annottext">getFastStringZEncCounter :: IO Int
</span><a href="GHC.Data.FastString.html#getFastStringZEncCounter"><span class="hs-identifier hs-var hs-var">getFastStringZEncCounter</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IORef Int -&gt; IO Int
forall a. IORef a -&gt; IO a
</span><a href="../../base/src/GHC.IORef.html#readIORef"><span class="hs-identifier hs-var">readIORef</span></a></span><span> </span><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680781869"><span class="hs-identifier hs-var">n_zencs</span></a></span><span>
</span><span id="line-586"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-587"></span><span>    </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastString.html#FastStringTable"><span class="hs-identifier hs-type">FastStringTable</span></a></span><span> </span><span class="annot"><span class="annottext">IORef Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680781869"><span class="annot"><span class="annottext">IORef Int
</span><a href="#local-6989586621680781869"><span class="hs-identifier hs-var">n_zencs</span></a></span></span><span> </span><span class="annot"><span class="annottext">Array# (IORef FastStringTableSegment)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FastStringTable
</span><a href="GHC.Data.FastString.html#stringTable"><span class="hs-identifier hs-var">stringTable</span></a></span><span>
</span><span id="line-588"></span><span>
</span><span id="line-589"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-590"></span><span class="hs-comment">-- Outputting 'FastString's</span><span>
</span><span id="line-591"></span><span>
</span><span id="line-592"></span><span class="hs-comment">-- |Outputs a 'FastString' with /no decoding at all/, that is, you</span><span>
</span><span id="line-593"></span><span class="hs-comment">-- get the actual bytes in the 'FastString' written to the 'Handle'.</span><span>
</span><span id="line-594"></span><span class="annot"><a href="GHC.Data.FastString.html#hPutFS"><span class="hs-identifier hs-type">hPutFS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">Handle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-595"></span><span id="hPutFS"><span class="annot"><span class="annottext">hPutFS :: Handle -&gt; FastString -&gt; IO ()
</span><a href="GHC.Data.FastString.html#hPutFS"><span class="hs-identifier hs-var hs-var">hPutFS</span></a></span></span><span> </span><span id="local-6989586621680781868"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621680781868"><span class="hs-identifier hs-var">handle</span></a></span></span><span> </span><span id="local-6989586621680781867"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781867"><span class="hs-identifier hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Handle -&gt; ByteString -&gt; IO ()
</span><a href="../../bytestring/src/Data.ByteString.html#hPut"><span class="hs-identifier hs-var">BS.hPut</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621680781868"><span class="hs-identifier hs-var">handle</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; IO ()) -&gt; ByteString -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; ByteString
</span><a href="GHC.Data.FastString.html#bytesFS"><span class="hs-identifier hs-var">bytesFS</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621680781867"><span class="hs-identifier hs-var">fs</span></a></span><span>
</span><span id="line-596"></span><span>
</span><span id="line-597"></span><span class="hs-comment">-- ToDo: we'll probably want an hPutFSLocal, or something, to output</span><span>
</span><span id="line-598"></span><span class="hs-comment">-- in the current locale's encoding (for error messages and suchlike).</span><span>
</span><span id="line-599"></span><span>
</span><span id="line-600"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-601"></span><span class="hs-comment">-- PtrStrings, here for convenience only.</span><span>
</span><span id="line-602"></span><span>
</span><span id="line-603"></span><span class="hs-comment">-- | A 'PtrString' is a pointer to some array of Latin-1 encoded chars.</span><span>
</span><span id="line-604"></span><span class="hs-keyword">data</span><span> </span><span id="PtrString"><span class="annot"><a href="GHC.Data.FastString.html#PtrString"><span class="hs-identifier hs-var">PtrString</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="PtrString"><span class="annot"><a href="GHC.Data.FastString.html#PtrString"><span class="hs-identifier hs-var">PtrString</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">!</span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-605"></span><span>
</span><span id="line-606"></span><span class="hs-comment">-- | Wrap an unboxed address into a 'PtrString'.</span><span>
</span><span id="line-607"></span><span class="annot"><a href="GHC.Data.FastString.html#mkPtrString%23"><span class="hs-identifier hs-type">mkPtrString#</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Addr#</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#PtrString"><span class="hs-identifier hs-type">PtrString</span></a></span><span>
</span><span id="line-608"></span><span id="mkPtrString%23"><span class="annot"><span class="annottext">mkPtrString# :: Addr# -&gt; PtrString
</span><a href="GHC.Data.FastString.html#mkPtrString%23"><span class="hs-identifier hs-var hs-var">mkPtrString#</span></a></span></span><span> </span><span id="local-6989586621680781865"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680781865"><span class="hs-identifier hs-var">a#</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; PtrString
</span><a href="GHC.Data.FastString.html#PtrString"><span class="hs-identifier hs-var">PtrString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Addr# -&gt; Ptr Word8
forall a. Addr# -&gt; Ptr a
</span><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-var">Ptr</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680781865"><span class="hs-identifier hs-var">a#</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int
</span><a href="GHC.Data.FastString.html#ptrStrLength"><span class="hs-identifier hs-var">ptrStrLength</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Addr# -&gt; Ptr Word8
forall a. Addr# -&gt; Ptr a
</span><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-var">Ptr</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680781865"><span class="hs-identifier hs-var">a#</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-609"></span><span>
</span><span id="line-610"></span><span class="hs-comment">-- | Encode a 'String' into a newly allocated 'PtrString' using Latin-1</span><span>
</span><span id="line-611"></span><span class="hs-comment">-- encoding.  The original string must not contain non-Latin-1 characters</span><span>
</span><span id="line-612"></span><span class="hs-comment">-- (above codepoint @0xff@).</span><span>
</span><span id="line-613"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#mkPtrString"><span class="hs-pragma hs-type">mkPtrString</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-614"></span><span class="annot"><a href="GHC.Data.FastString.html#mkPtrString"><span class="hs-identifier hs-type">mkPtrString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#PtrString"><span class="hs-identifier hs-type">PtrString</span></a></span><span>
</span><span id="line-615"></span><span id="mkPtrString"><span class="annot"><span class="annottext">mkPtrString :: String -&gt; PtrString
</span><a href="GHC.Data.FastString.html#mkPtrString"><span class="hs-identifier hs-var hs-var">mkPtrString</span></a></span></span><span> </span><span id="local-6989586621680781864"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680781864"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-616"></span><span> </span><span class="hs-comment">-- we don't use `unsafeDupablePerformIO` here to avoid potential memory leaks</span><span>
</span><span id="line-617"></span><span> </span><span class="hs-comment">-- and because someone might be using `eqAddr#` to check for string equality.</span><span>
</span><span id="line-618"></span><span> </span><span class="annot"><span class="annottext">IO PtrString -&gt; PtrString
forall a. IO a -&gt; a
</span><a href="../../base/src/GHC.IO.Unsafe.html#unsafePerformIO"><span class="hs-identifier hs-var">unsafePerformIO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">do</span><span>
</span><span id="line-619"></span><span>   </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621680781862"><span class="annot"><span class="annottext">len :: Int
</span><a href="#local-6989586621680781862"><span class="hs-identifier hs-var hs-var">len</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680781864"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-620"></span><span>   </span><span id="local-6989586621680781860"><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621680781860"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int -&gt; IO (Ptr Word8)
forall a. Int -&gt; IO (Ptr a)
</span><a href="../../base/src/Foreign.Marshal.Alloc.html#mallocBytes"><span class="hs-identifier hs-var">mallocBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781862"><span class="hs-identifier hs-var">len</span></a></span><span>
</span><span id="line-621"></span><span>   </span><span class="hs-keyword">let</span><span>
</span><span id="line-622"></span><span>     </span><span class="annot"><a href="#local-6989586621680781858"><span class="hs-identifier hs-type">loop</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-623"></span><span>     </span><span id="local-6989586621680781858"><span class="annot"><span class="annottext">loop :: Int -&gt; String -&gt; IO ()
</span><a href="#local-6989586621680781858"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IO ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-624"></span><span>     </span><span class="annot"><a href="#local-6989586621680781858"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span id="local-6989586621680781857"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781857"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680781856"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680781856"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680781855"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680781855"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-625"></span><span>        </span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; Word8 -&gt; IO ()
forall a b. Storable a =&gt; Ptr b -&gt; Int -&gt; a -&gt; IO ()
</span><a href="../../base/src/Foreign.Storable.html#pokeByteOff"><span class="hs-identifier hs-var">pokeByteOff</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621680781860"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781857"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Word8
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="../../base/src/GHC.Base.html#ord"><span class="hs-identifier hs-var">ord</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621680781856"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-626"></span><span>        </span><span class="annot"><span class="annottext">Int -&gt; String -&gt; IO ()
</span><a href="#local-6989586621680781858"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781857"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680781855"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-627"></span><span>   </span><span class="annot"><span class="annottext">Int -&gt; String -&gt; IO ()
</span><a href="#local-6989586621680781858"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680781864"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-628"></span><span>   </span><span class="annot"><span class="annottext">PtrString -&gt; IO PtrString
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr Word8 -&gt; Int -&gt; PtrString
</span><a href="GHC.Data.FastString.html#PtrString"><span class="hs-identifier hs-var">PtrString</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8
</span><a href="#local-6989586621680781860"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781862"><span class="hs-identifier hs-var">len</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-629"></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-630"></span><span>
</span><span id="line-631"></span><span class="hs-comment">-- | Decode a 'PtrString' back into a 'String' using Latin-1 encoding.</span><span>
</span><span id="line-632"></span><span class="hs-comment">-- This does not free the memory associated with 'PtrString'.</span><span>
</span><span id="line-633"></span><span class="annot"><a href="GHC.Data.FastString.html#unpackPtrString"><span class="hs-identifier hs-type">unpackPtrString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#PtrString"><span class="hs-identifier hs-type">PtrString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-634"></span><span id="unpackPtrString"><span class="annot"><span class="annottext">unpackPtrString :: PtrString -&gt; String
</span><a href="GHC.Data.FastString.html#unpackPtrString"><span class="hs-identifier hs-var hs-var">unpackPtrString</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastString.html#PtrString"><span class="hs-identifier hs-type">PtrString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span id="local-6989586621680781852"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680781852"><span class="hs-identifier hs-var">p#</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">I#</span></span><span> </span><span id="local-6989586621680781851"><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781851"><span class="hs-identifier hs-var">n#</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Addr# -&gt; Int# -&gt; String
</span><span class="hs-identifier hs-var">unpackNBytes#</span></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621680781852"><span class="hs-identifier hs-var">p#</span></a></span><span> </span><span class="annot"><span class="annottext">Int#
</span><a href="#local-6989586621680781851"><span class="hs-identifier hs-var">n#</span></a></span><span>
</span><span id="line-635"></span><span>
</span><span id="line-636"></span><span class="hs-comment">-- | Return the length of a 'PtrString'</span><span>
</span><span id="line-637"></span><span class="annot"><a href="GHC.Data.FastString.html#lengthPS"><span class="hs-identifier hs-type">lengthPS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#PtrString"><span class="hs-identifier hs-type">PtrString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-638"></span><span id="lengthPS"><span class="annot"><span class="annottext">lengthPS :: PtrString -&gt; Int
</span><a href="GHC.Data.FastString.html#lengthPS"><span class="hs-identifier hs-var hs-var">lengthPS</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.FastString.html#PtrString"><span class="hs-identifier hs-type">PtrString</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr Word8
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680781849"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781849"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621680781849"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-639"></span><span>
</span><span id="line-640"></span><span class="hs-comment">-- -----------------------------------------------------------------------------</span><span>
</span><span id="line-641"></span><span class="hs-comment">-- under the carpet</span><span>
</span><span id="line-642"></span><span>
</span><span id="line-643"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="annot"><span class="hs-keyword">ccall</span></span><span> </span><span class="annot"><span class="hs-keyword">unsafe</span></span><span> </span><span class="annot"><span class="hs-string">&quot;strlen&quot;</span></span><span>
</span><span id="line-644"></span><span>  </span><span id="ptrStrLength"><span class="annot"><a href="GHC.Data.FastString.html#ptrStrLength"><span class="hs-identifier hs-var">ptrStrLength</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-645"></span><span>
</span><span id="line-646"></span><span class="hs-pragma">{-# NOINLINE</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#sLit"><span class="hs-pragma hs-type">sLit</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-647"></span><span class="annot"><a href="GHC.Data.FastString.html#sLit"><span class="hs-identifier hs-type">sLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#PtrString"><span class="hs-identifier hs-type">PtrString</span></a></span><span>
</span><span id="line-648"></span><span id="sLit"><span class="annot"><span class="annottext">sLit :: String -&gt; PtrString
</span><a href="GHC.Data.FastString.html#sLit"><span class="hs-identifier hs-var hs-var">sLit</span></a></span></span><span> </span><span id="local-6989586621680781848"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680781848"><span class="hs-identifier hs-var">x</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; PtrString
</span><a href="GHC.Data.FastString.html#mkPtrString"><span class="hs-identifier hs-var">mkPtrString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680781848"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-649"></span><span>
</span><span id="line-650"></span><span class="hs-pragma">{-# NOINLINE</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#fsLit"><span class="hs-pragma hs-type">fsLit</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-651"></span><span class="annot"><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-type">fsLit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-652"></span><span id="fsLit"><span class="annot"><span class="annottext">fsLit :: String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var hs-var">fsLit</span></a></span></span><span> </span><span id="local-6989586621680781847"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680781847"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621680781847"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-653"></span><span>
</span><span id="line-654"></span><span class="hs-pragma">{-# RULES</span><span> </span><span class="annot"><span class="hs-pragma">&quot;slit&quot;</span></span><span>
</span><span id="line-655"></span><span>    </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621680781846"><span class="annot"><a href="#local-6989586621680781846"><span class="hs-pragma hs-var">x</span></a></span></span><span> </span><span class="hs-pragma">.</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#sLit"><span class="hs-pragma hs-type">sLit</span></a></span><span>  </span><span class="hs-pragma">(</span><span class="annot"><span class="hs-pragma hs-type">unpackCString#</span></span><span> </span><span class="annot"><a href="#local-6989586621680781846"><span class="hs-pragma hs-type">x</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#mkPtrString%23"><span class="hs-pragma hs-type">mkPtrString#</span></a></span><span>  </span><span class="annot"><a href="#local-6989586621680781846"><span class="hs-pragma hs-type">x</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-656"></span><span class="hs-pragma">{-# RULES</span><span> </span><span class="annot"><span class="hs-pragma">&quot;fslit&quot;</span></span><span>
</span><span id="line-657"></span><span>    </span><span class="hs-pragma">forall</span><span> </span><span id="local-6989586621680781845"><span class="annot"><a href="#local-6989586621680781845"><span class="hs-pragma hs-var">x</span></a></span></span><span> </span><span class="hs-pragma">.</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#fsLit"><span class="hs-pragma hs-type">fsLit</span></a></span><span> </span><span class="hs-pragma">(</span><span class="annot"><span class="hs-pragma hs-type">unpackCString#</span></span><span> </span><span class="annot"><a href="#local-6989586621680781845"><span class="hs-pragma hs-type">x</span></a></span><span class="hs-pragma">)</span><span> </span><span class="hs-pragma">=</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#mkFastString%23"><span class="hs-pragma hs-type">mkFastString#</span></a></span><span> </span><span class="annot"><a href="#local-6989586621680781845"><span class="hs-pragma hs-type">x</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-658"></span></pre></body></html>